PHP Class GuzzleHttp\Client

Inheritance: implements guzzlehttp\ClientInterface, use trait GuzzleHttp\Event\HasEmitterTrait
Afficher le fichier Open project: nystudio107/instantanalytics Class Usage Examples

Méthodes publiques

Méthode Description
__call ( $method, $args )
__construct ( array $config = [] ) Clients accept an array of constructor parameters.
getConfig ( $option = null )
request ( $method, $uri = '', array $options = [] )
requestAsync ( $method, $uri = '', array $options = [] )
send ( Psr\Http\Message\RequestInterface $request, array $options = [] )
sendAsync ( Psr\Http\Message\RequestInterface $request, array $options = [] )

Private Methods

Méthode Description
applyOptions ( Psr\Http\Message\RequestInterface $request, array &$options ) : Psr\Http\Message\RequestInterface Applies the array of request options to a request.
buildUri ( $uri, array $config )
configureDefaults ( array $config ) Configures the default options for a client.
invalidBody ( )
prepareDefaults ( array $options ) : array Merges default options into the array.
transfer ( Psr\Http\Message\RequestInterface $request, array $options ) : GuzzleHttp\Promise\PromiseInterface Transfers the given request and applies request options.

Method Details

__call() public méthode

public __call ( $method, $args )

__construct() public méthode

Here's an example of creating a client using a base_uri and an array of default request options to apply to each request: $client = new Client([ 'base_uri' => 'http://www.foo.com/1.0/', 'timeout' => 0, 'allow_redirects' => false, 'proxy' => '192.168.16.1:10' ]); Client configuration settings include the following options: - handler: (callable) Function that transfers HTTP requests over the wire. The function is called with a Psr7\Http\Message\RequestInterface and array of transfer options, and must return a GuzzleHttp\Promise\PromiseInterface that is fulfilled with a Psr7\Http\Message\ResponseInterface on success. "handler" is a constructor only option that cannot be overridden in per/request options. If no handler is provided, a default handler will be created that enables all of the request options below by attaching all of the default middleware to the handler. - base_uri: (string|UriInterface) Base URI of the client that is merged into relative URIs. Can be a string or instance of UriInterface. - **: any request option
See also: GuzzleHttp\RequestOptions for a list of available request options.
public __construct ( array $config = [] )
$config array Client configuration settings.

getConfig() public méthode

public getConfig ( $option = null )

request() public méthode

public request ( $method, $uri = '', array $options = [] )
$options array

requestAsync() public méthode

public requestAsync ( $method, $uri = '', array $options = [] )
$options array

send() public méthode

public send ( Psr\Http\Message\RequestInterface $request, array $options = [] )
$request Psr\Http\Message\RequestInterface
$options array

sendAsync() public méthode

public sendAsync ( Psr\Http\Message\RequestInterface $request, array $options = [] )
$request Psr\Http\Message\RequestInterface
$options array