]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/IHTTPRequest.php
Issue 9657: Check the age of an item
[friendica.git] / src / Network / IHTTPRequest.php
index 49993085e63c938597415e509edce2784abb5056..8927941e813594672e49d6ca7bc2b5075456cc96 100644 (file)
@@ -29,20 +29,17 @@ interface IHTTPRequest
        /**
         * Fetches the content of an URL
         *
-        * If binary flag is true, return binary results.
         * Set the cookiejar argument to a string (e.g. "/tmp/friendica-cookies.txt")
         * to preserve cookies from one request to the next.
         *
         * @param string $url             URL to fetch
-        * @param bool   $binary          default false
-        *                                TRUE if asked to return binary results (file download)
         * @param int    $timeout         Timeout in seconds, default system config value or 60 seconds
         * @param string $accept_content  supply Accept: header with 'accept_content' as the value
         * @param string $cookiejar       Path to cookie jar file
         *
         * @return string The fetched content
         */
-       public function fetch(string $url, bool $binary = false, int $timeout = 0, string $accept_content = '', string $cookiejar = '');
+       public function fetch(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '');
 
        /**
         * Fetches the whole response of an URL.
@@ -51,35 +48,41 @@ interface IHTTPRequest
         * all the information collected during the fetch.
         *
         * @param string $url             URL to fetch
-        * @param bool   $binary          default false
-        *                                TRUE if asked to return binary results (file download)
         * @param int    $timeout         Timeout in seconds, default system config value or 60 seconds
         * @param string $accept_content  supply Accept: header with 'accept_content' as the value
         * @param string $cookiejar       Path to cookie jar file
         *
-        * @return IHTTPResult With all relevant information, 'body' contains the actual fetched content.
+        * @return CurlResult With all relevant information, 'body' contains the actual fetched content.
         */
-       public function fetchFull(string $url, bool $binary = false, int $timeout = 0, string $accept_content = '', string $cookiejar = '');
+       public function fetchFull(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '');
+
+       /**
+        * Send a HEAD to an URL.
+        *
+        * @param string $url        URL to fetch
+        * @param array  $opts       (optional parameters) assoziative array with:
+        *                           'accept_content' => supply Accept: header with 'accept_content' as the value
+        *                           'timeout' => int Timeout in seconds, default system config value or 60 seconds
+        *                           'cookiejar' => path to cookie jar file
+        *                           'header' => header array
+        *
+        * @return CurlResult
+        */
+       public function head(string $url, array $opts = []);
 
        /**
         * Send a GET to an URL.
         *
         * @param string $url        URL to fetch
-        * @param bool   $binary     default false
-        *                           TRUE if asked to return binary results (file download)
         * @param array  $opts       (optional parameters) assoziative array with:
         *                           'accept_content' => supply Accept: header with 'accept_content' as the value
         *                           'timeout' => int Timeout in seconds, default system config value or 60 seconds
-        *                           'http_auth' => username:password
-        *                           'novalidate' => do not validate SSL certs, default is to validate using our CA list
-        *                           'nobody' => only return the header
         *                           'cookiejar' => path to cookie jar file
         *                           'header' => header array
-        *                           'content_length' => int maximum File content length
         *
-        * @return IHTTPResult
+        * @return CurlResult
         */
-       public function get(string $url, bool $binary = false, array $opts = []);
+       public function get(string $url, array $opts = []);
 
        /**
         * Send POST request to an URL
@@ -89,7 +92,7 @@ interface IHTTPRequest
         * @param array  $headers HTTP headers
         * @param int    $timeout The timeout in seconds, default system config value or 60 seconds
         *
-        * @return IHTTPResult The content
+        * @return CurlResult The content
         */
        public function post(string $url, $params, array $headers = [], int $timeout = 0);