Remove accept parameter for head/post again

This commit is contained in:
Philipp 2022-04-03 19:33:09 +02:00
parent 4aeccd3157
commit 04866195b4
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
12 changed files with 54 additions and 57 deletions

View file

@ -59,21 +59,6 @@ interface ICanSendHttpRequests
*/
public function fetchFull(string $url, string $accept_content = HttpClientAccept::DEFAULT, int $timeout = 0, string $cookiejar = ''): ICanHandleHttpResponses;
/**
* Send a HEAD to a URL.
*
* @param string $url URL to fetch
* @param string $accept_content supply Accept: header with 'accept_content' as the value
* @param array $opts (optional parameters) associative array with:
* 'accept_content' => (string array) supply Accept: header with 'accept_content' as the value (overrides default parameter)
* 'timeout' => int Timeout in seconds, default system config value or 60 seconds
* 'cookiejar' => path to cookie jar file
* 'header' => header array
*
* @return ICanHandleHttpResponses
*/
public function head(string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ICanHandleHttpResponses;
/**
* Send a GET to a URL.
*
@ -90,14 +75,39 @@ interface ICanSendHttpRequests
public function get(string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ICanHandleHttpResponses;
/**
* Sends a HTTP request to a given url
* Send a HEAD to a URL.
*
* @param string $url URL to fetch
* @param array $opts (optional parameters) associative array with:
* 'accept_content' => (string array) supply Accept: header with 'accept_content' as the value (overrides default parameter)
* 'timeout' => int Timeout in seconds, default system config value or 60 seconds
* 'cookiejar' => path to cookie jar file
* 'header' => header array
*
* @return ICanHandleHttpResponses
*/
public function head(string $url, array $opts = []): ICanHandleHttpResponses;
/**
* Send POST request to an URL
*
* @param string $url URL to post
* @param mixed $params array of POST variables
* @param array $headers HTTP headers
* @param int $timeout The timeout in seconds, default system config value or 60 seconds
*
* @return ICanHandleHttpResponses The content
*/
public function post(string $url, $params, array $headers = [], int $timeout = 0): ICanHandleHttpResponses;
/**
* Sends an HTTP request to a given url
*
* @param string $method A HTTP request
* @param string $url Url to send to
* @param string $accept_content supply Accept: header with 'accept_content' as the value
* @param array $opts (optional parameters) associative array with:
* 'body' => (mixed) setting the body for sending data
* 'accept_content' => (string array) supply Accept: header with 'accept_content' as the value (overrides default parameter)
* 'accept_content' => (string array) 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
@ -106,20 +116,7 @@ interface ICanSendHttpRequests
*
* @return ICanHandleHttpResponses
*/
public function request(string $method, string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ICanHandleHttpResponses;
/**
* Send POST request to an URL
*
* @param string $url URL to post
* @param mixed $params array of POST variables
* @param string $accept_content supply Accept: header with 'accept_content' as the value
* @param array $headers HTTP headers
* @param int $timeout The timeout in seconds, default system config value or 60 seconds
*
* @return ICanHandleHttpResponses The content
*/
public function post(string $url, $params, string $accept_content = HttpClientAccept::DEFAULT, array $headers = [], int $timeout = 0): ICanHandleHttpResponses;
public function request(string $method, string $url, array $opts = []): ICanHandleHttpResponses;
/**
* Returns the original URL of the provided URL