From fbb4020738dff1ae32bda197639a75b43a5d71b6 Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Sat, 15 Sep 2018 20:54:28 +0200 Subject: [PATCH] Created The getContents function (markdown) --- The-getContents-function.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 The-getContents-function.md 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