mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-21 09:05:26 +03:00
1
The getContents function
LogMANOriginal edited this page 2018-09-15 20:54:28 +02:00
The getContents
function uses cURL 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 |
opts |
array | optional | An array of cURL options in the format array(CURLOPT_POST => 1); , see curl_setopt for a complete list of options. |
$header = array('Content-type:text/plain', 'Content-length: 100');
$opts = array(CURLOPT_POST => 1);
$html = getContents($url, $header, $opts);