CurlClient
extends HTTPClientAbstract
in package
A "simple" cURL http client
Table of Contents
Properties
- $logger : LoggerInterface
- $options : HTTPOptions|SettingsContainerInterface
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface|null
Methods
- __construct() : mixed
- HTTPClientAbstract constructor.
- sendRequest() : ResponseInterface
- setLogger() : static
- Sets a PSR-3 Logger
- setResponseFactory() : static
- Sets a PSR-17 response factory
- setStreamFactory() : static
- Sets a PSR-17 stream factory
Properties
$logger
protected
LoggerInterface
$logger
= new NullLogger()
$options
protected
HTTPOptions|SettingsContainerInterface
$options
= new HTTPOptions()
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
$streamFactory
protected
StreamFactoryInterface|null
$streamFactory
= null
Methods
__construct()
HTTPClientAbstract constructor.
public
__construct(ResponseFactoryInterface $responseFactory[, HTTPOptions|SettingsContainerInterface $options = new HTTPOptions() ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
- $responseFactory : ResponseFactoryInterface
- $options : HTTPOptions|SettingsContainerInterface = new HTTPOptions()
- $logger : LoggerInterface = new NullLogger()
sendRequest()
public
sendRequest(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface
Tags
Return values
ResponseInterfacesetLogger()
Sets a PSR-3 Logger
public
setLogger(LoggerInterface $logger) : static
Parameters
- $logger : LoggerInterface
Tags
Return values
staticsetResponseFactory()
Sets a PSR-17 response factory
public
setResponseFactory(ResponseFactoryInterface $responseFactory) : static
Parameters
- $responseFactory : ResponseFactoryInterface
Tags
Return values
staticsetStreamFactory()
Sets a PSR-17 stream factory
public
setStreamFactory(StreamFactoryInterface $streamFactory) : static
Parameters
- $streamFactory : StreamFactoryInterface