diff --git a/The-getContents-function.md b/The-getContents-function.md new file mode 100644 index 0000000..aefda4a --- /dev/null +++ b/The-getContents-function.md @@ -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); +``` \ No newline at end of file