HttpMethodsClientInterface
extends
HttpClient
in
Convenience HTTP client that integrates the MessageFactory in order to send requests in the following form:.
$client ->get('/foo') ->post('/bar') ;
The client also exposes the sendRequest methods of the wrapped HttpClient.
Tags
Table of Contents
Methods
- delete() : ResponseInterface
- Sends a DELETE request.
- get() : ResponseInterface
- Sends a GET request.
- head() : ResponseInterface
- Sends an HEAD request.
- options() : ResponseInterface
- Sends an OPTIONS request.
- patch() : ResponseInterface
- Sends a PATCH request.
- post() : ResponseInterface
- Sends a POST request.
- put() : ResponseInterface
- Sends a PUT request.
- send() : ResponseInterface
- Sends a request with any HTTP method.
- sendRequest() : ResponseInterface
- Sends a PSR-7 request and returns a PSR-7 response.
- trace() : ResponseInterface
- Sends a TRACE request.
Methods
delete()
Sends a DELETE request.
public
delete(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|StreamInterface|null $body = null ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
- $body : string|StreamInterface|null = null
Tags
Return values
ResponseInterfaceget()
Sends a GET request.
public
get(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
Tags
Return values
ResponseInterfacehead()
Sends an HEAD request.
public
head(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
Tags
Return values
ResponseInterfaceoptions()
Sends an OPTIONS request.
public
options(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|StreamInterface|null $body = null ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
- $body : string|StreamInterface|null = null
Tags
Return values
ResponseInterfacepatch()
Sends a PATCH request.
public
patch(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|StreamInterface|null $body = null ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
- $body : string|StreamInterface|null = null
Tags
Return values
ResponseInterfacepost()
Sends a POST request.
public
post(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|StreamInterface|null $body = null ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
- $body : string|StreamInterface|null = null
Tags
Return values
ResponseInterfaceput()
Sends a PUT request.
public
put(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|StreamInterface|null $body = null ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
- $body : string|StreamInterface|null = null
Tags
Return values
ResponseInterfacesend()
Sends a request with any HTTP method.
public
send(string $method, string|UriInterface $uri[, array<string|int, mixed> $headers = [] ][, string|StreamInterface|null $body = null ]) : ResponseInterface
Parameters
- $method : string
-
HTTP method to use
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []
- $body : string|StreamInterface|null = null
Tags
Return values
ResponseInterfacesendRequest()
Sends a PSR-7 request and returns a PSR-7 response.
public
sendRequest(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface
Tags
Return values
ResponseInterfacetrace()
Sends a TRACE request.
public
trace(string|UriInterface $uri[, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $uri : string|UriInterface
- $headers : array<string|int, mixed> = []