HttpClient
class HttpClient implements HttpClientInterface (View source)
The HttpClient class.
Methods
Request a remote server.
Download file to target path.
Send a request to remote.
Method to send the OPTIONS command to the server.
Method to send the HEAD command to the server.
Method to send the GET command to the server.
Method to send the POST command to the server.
Method to send the PUT command to the server.
Method to send the DELETE command to the server.
Method to send the TRACE command to the server.
Method to send the PATCH command to the server.
Get option value.
Set option value.
Method to get property Options
Method to set property options
Method to get property Transport
Details
at line line 47
__construct(array $options = array(), TransportInterface $transport = null)
Class init.
at line line 65
ResponseInterface
request(string $method, string|object $url, mixed $data = null, array $headers = array())
Request a remote server.
This method will build a Request object and use send() method to send request.
at line line 82
ResponseInterface
download(string|object $url, string $dest, mixed $data = null, array $headers = array())
Download file to target path.
at line line 103
ResponseInterface
send(RequestInterface $request)
Send a request to remote.
at line line 125
ResponseInterface
options(string $url, array $headers = array())
Method to send the OPTIONS command to the server.
at line line 140
ResponseInterface
head(string $url, array $headers = array())
Method to send the HEAD command to the server.
at line line 156
ResponseInterface
get(string $url, mixed $data = null, array $headers = array())
Method to send the GET command to the server.
at line line 172
ResponseInterface
post(string $url, mixed $data, array $headers = array())
Method to send the POST command to the server.
at line line 188
ResponseInterface
put(string $url, mixed $data, array $headers = array())
Method to send the PUT command to the server.
at line line 204
ResponseInterface
delete(string $url, mixed $data = null, array $headers = array())
Method to send the DELETE command to the server.
at line line 219
ResponseInterface
trace(string $url, array $headers = array())
Method to send the TRACE command to the server.
at line line 235
ResponseInterface
patch(string $url, mixed $data, array $headers = array())
Method to send the PATCH command to the server.
at line line 248
mixed
getOption(string $name, mixed $default = null)
Get option value.
at line line 266
HttpClient
setOption(string $name, mixed $value)
Set option value.
at line line 278
array
getOptions()
Method to get property Options
at line line 290
HttpClient
setOptions(array $options)
Method to set property options
at line line 312
TransportInterface
getTransport()
Method to get property Transport
at line line 324
HttpClient
setTransport(TransportInterface $transport)
Method to set property transport