A http client wrapper for PHP 7.2+.
method | return |
---|---|
request(string $url, array $params = null, string $method = null, $body = null, array $headers = null) |
HTTPResponseInterface |
normalizeRequestHeaders(array $headers) |
array |
buildQuery(array $params, bool $urlencode = null, string $delimiter = null, string $enclosure = null) |
string |
checkQueryParams(array $params, bool $booleans_as_string = null) |
array |
The HTTPClientTrait
provides several (protected) shortcut methods for the HTTPClientInterface
.
method | return |
---|---|
setHTTPClient(HTTPClientInterface $http) |
$this |
httpRequest(string $url, array $params = null, string $method = null, $body = null, array $headers = null) |
HTTPResponseInterface |
httpDELETE(string $url, array $params = null, array $headers = null) |
HTTPResponseInterface |
httpGET(string $url, array $params = null, array $headers = null) |
HTTPResponseInterface |
httpPATCH(string $url, array $params = null, $body = null, array $headers = null) |
HTTPResponseInterface |
httpPOST(string $url, array $params = null, $body = null, array $headers = null) |
HTTPResponseInterface |
httpPUT(string $url, array $params = null, $body = null, array $headers = null) |
HTTPResponseInterface |
normalizeRequestHeaders(array $headers) |
array |
checkQueryParams($params, bool $booleans_as_string = null) |
mixed |
httpBuildQuery(array $params, bool $urlencode = null, string $delimiter = null, string $enclosure = null) |
string |