mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-15 08:24:44 +02:00
Created The getContents function (markdown)
parent
2ea0cff7b3
commit
fbb4020738
1 changed files with 13 additions and 0 deletions
13
The-getContents-function.md
Normal file
13
The-getContents-function.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
The `getContents` function uses [cURL](https://secure.php.net/manual/en/book.curl.php) to acquire data from the specified URI while respecting the various settings defined at a global level by RSS-Bridge (i.e., proxy host, user agent, etc.). This function accepts a few parameters:
|
||||
|
||||
| Parameter | Type | Optional | Description
|
||||
| --------- | ------ | ---------- | ----------
|
||||
| `url` | string | *required* | The URL of the contents to acquire
|
||||
| `header` | array | *optional* | An array of HTTP header fields to set, in the format `array('Content-type: text/plain', 'Content-length: 100')`, see [CURLOPT_HTTPHEADER](https://secure.php.net/manual/en/function.curl-setopt.php)
|
||||
| `opts` | array | *optional* | An array of cURL options in the format `array(CURLOPT_POST => 1);`, see [curl_setopt](https://secure.php.net/manual/en/function.curl-setopt.php) for a complete list of options.
|
||||
|
||||
```PHP
|
||||
$header = array('Content-type:text/plain', 'Content-length: 100');
|
||||
$opts = array(CURLOPT_POST => 1);
|
||||
$html = getContents($url, $header, $opts);
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue