Methods summary
public static
array
|
#
getAllEvents( )
Get a list of all of the events emitted from the class
Get a list of all of the events emitted from the class
Returns
array
Overrides
Implementation of
|
public
|
|
final public
Guzzle\Http\Client
|
#
setConfig( array|Guzzle\Common\Collection $config )
Set the configuration object to use with the client
Set the configuration object to use with the client
Parameters
- $config
- Parameters that define how the client behaves
Returns
Implementation of
|
final public
mixed|Guzzle\Common\Collection
|
#
getConfig( boolean|string $key = false )
Get a configuration setting or all of the configuration settings. The Collection result of this method can be
modified to change the configuration settings of a client.
Get a configuration setting or all of the configuration settings. The Collection result of this method can be
modified to change the configuration settings of a client.
A client should honor the following special values:
- request.options: Associative array of default RequestFactory options to apply to each request
- request.params: Associative array of request parameters (data values) to apply to each request
- curl.options: Associative array of cURL configuration settings to apply to each request
- ssl.certificate_authority: Path a CAINFO, CAPATH, true to use strict defaults, or false to disable verification
- redirect.disable: Set to true to disable redirects
Parameters
- $key
Configuration value to retrieve. Set to FALSE to retrieve all values of the client.
The object return can be modified, and modifications will affect the client's config.
Returns
See
\Guzzle\Http\Message\RequestFactoryInterface::applyOptions for a full list of request.options options
Implementation of
|
public
|
#
setDefaultOption( string $keyOrPath, mixed $value )
Set a default request option on the client that will be used as a default for each request
Set a default request option on the client that will be used as a default for each request
Parameters
- $keyOrPath
- request.options key (e.g. allow_redirects) or path to a nested key (e.g. headers/foo)
- $value
- Value to set
Returns
$this
|
public
mixed|null
|
#
getDefaultOption( string $keyOrPath )
Retrieve a default request option from the client
Retrieve a default request option from the client
Parameters
- $keyOrPath
- request.options key (e.g. allow_redirects) or path to a nested key (e.g. headers/foo)
Returns
mixed|null
|
final public
Guzzle\Http\Client
|
#
setSslVerification( string|boolean $certificateAuthority = true, boolean $verifyPeer = true, integer $verifyHost = 2 )
Set SSL verification options.
Set SSL verification options.
Setting $certificateAuthority to TRUE will result in the bundled cacert.pem being used to verify against the
remote host.
Alternate certificates to verify against can be specified with the $certificateAuthority option set to the full
path to a certificate file, or the path to a directory containing certificates.
Setting $certificateAuthority to FALSE will turn off peer verification, unset the bundled cacert.pem, and
disable host verification. Please don't do this unless you really know what you're doing, and why you're doing
it.
Parameters
- $certificateAuthority
- bool, file path, or directory path
- $verifyPeer
- FALSE to stop from verifying the peer's certificate.
- $verifyHost
Set to 1 to check the existence of a common name in the SSL peer
certificate. 2 to check the existence of a common name and also verify
that it matches the hostname provided.
Returns
Implementation of
|
public
Guzzle\Http\Message\RequestInterface
|
#
createRequest( string $method = 'GET', string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|array|Guzzle\Http\EntityBodyInterface $body = null, array $options = array() )
Create and return a new Guzzle\Http\Message\RequestInterface configured for the client.
Use an absolute path to override the base path of the client, or a relative path to append to the base path of
the client. The URI can contain the query string as well. Use an array to provide a URI template and additional
variables to use in the URI template expansion.
Parameters
- $method
- HTTP method. Defaults to GET
- $uri
- Resource URI.
- $headers
- HTTP headers
- $body
- Entity body of request (POST/PUT) or response (GET)
- $options
- Array of options to apply to the request
Returns
Throws
InvalidArgumentException if a URI array is passed that does not contain exactly two elements: the URI
followed by template variables
Implementation of
|
public
string|null
|
#
getBaseUrl( boolean $expand = true )
Get the client's base URL as either an expanded or raw URI template
Get the client's base URL as either an expanded or raw URI template
Parameters
- $expand
- Set to FALSE to get the raw base URL without URI template expansion
Returns
string|null
Implementation of
|
public
Guzzle\Http\Client
|
#
setBaseUrl( string $url )
Set the base URL of the client
Set the base URL of the client
Parameters
- $url
- The base service endpoint URL of the webservice
Returns
Implementation of
|
public
Guzzle\Http\Client
|
#
setUserAgent( string $userAgent, boolean $includeDefault = false )
Set the User-Agent header to be used on all requests from the client
Set the User-Agent header to be used on all requests from the client
Parameters
- $userAgent
- User agent string
- $includeDefault
- Set to true to prepend the value to Guzzle's default user agent string
Returns
Implementation of
|
public
string
|
#
getDefaultUserAgent( )
Get the default User-Agent string to use with Guzzle
Get the default User-Agent string to use with Guzzle
Returns
string
|
public
Guzzle\Http\Message\RequestInterface
|
#
get( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, array $options = array() )
Create a GET request for the client
Create a GET request for the client
Parameters
- $uri
- Resource URI
- $headers
- HTTP headers
- $options
Options to apply to the request. For BC compatibility, you can also pass a
string to tell Guzzle to download the body of the response to a particular
location. Use the 'body' option instead for forward compatibility.
Returns
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
Guzzle\Http\Message\RequestInterface
|
#
head( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, array $options = array() )
Create a HEAD request for the client
Create a HEAD request for the client
Parameters
- $uri
- Resource URI
- $headers
- HTTP headers
- $options
- Options to apply to the request
Returns
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
EntityEnclosingRequestInterface
|
#
delete( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|Guzzle\Http\EntityBodyInterface $body = null, array $options = array() )
Create a DELETE request for the client
Create a DELETE request for the client
Parameters
- $uri
- Resource URI
- $headers
- HTTP headers
- $body
- Body to send in the request
- $options
- Options to apply to the request
Returns
EntityEnclosingRequestInterface
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
EntityEnclosingRequestInterface
|
#
put( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|Guzzle\Http\EntityBodyInterface $body = null, array $options = array() )
Create a PUT request for the client
Create a PUT request for the client
Parameters
- $uri
- Resource URI
- $headers
- HTTP headers
- $body
- Body to send in the request
- $options
- Options to apply to the request
Returns
EntityEnclosingRequestInterface
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
EntityEnclosingRequestInterface
|
#
patch( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|Guzzle\Http\EntityBodyInterface $body = null, array $options = array() )
Create a PATCH request for the client
Create a PATCH request for the client
Parameters
- $uri
- Resource URI
- $headers
- HTTP headers
- $body
- Body to send in the request
- $options
- Options to apply to the request
Returns
EntityEnclosingRequestInterface
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
EntityEnclosingRequestInterface
|
#
post( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, array|Guzzle\Common\Collection |string|Guzzle\Http\EntityBodyInterface $postBody = null, array $options = array() )
Create a POST request for the client
Create a POST request for the client
Parameters
- $uri
- Resource URI
- $headers
- HTTP headers
- $postBody
POST body. Can be a string, EntityBody, or
associative array of POST fields to send in the body of the
request. Prefix a value in the array with the @ symbol to
reference a file.
- $options
- Options to apply to the request
Returns
EntityEnclosingRequestInterface
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
Guzzle\Http\Message\RequestInterface
|
#
options( string|array $uri = null, array $options = array() )
Create an OPTIONS request for the client
Create an OPTIONS request for the client
Parameters
- $uri
- Resource URI
- $options
- Options to apply to the request
Returns
See
Guzzle\Http\ClientInterface::createRequest()
Implementation of
|
public
Guzzle\Http\Message\Response |array
|
#
send( array|Guzzle\Http\Message\RequestInterface $requests )
Sends a single request or an array of requests in parallel
Sends a single request or an array of requests in parallel
Parameters
- $requests
- One or more RequestInterface objects to send
Returns
Implementation of
|
public
Guzzle\Http\Client
|
#
setCurlMulti( Guzzle\Http\Curl\CurlMultiInterface $curlMulti )
Set a curl multi object to be used internally by the client for transferring requests.
Set a curl multi object to be used internally by the client for transferring requests.
Parameters
Returns
|
public
Guzzle\Http\Curl\CurlMultiInterface |Guzzle\Http\Curl\CurlMultiProxy
|
|
public
|
|
public
Guzzle\Http\Client
|
|
protected
string
|
#
expandTemplate( string $template, array $variables = null )
Expand a URI template while merging client config settings into the template variables
Expand a URI template while merging client config settings into the template variables
Parameters
- $template
- Template to expand
- $variables
- Variables to inject
Returns
string
|
protected
Guzzle\Parser\UriTemplate\UriTemplateInterface
|
#
getUriTemplate( )
Get the URI template expander used by the client
Get the URI template expander used by the client
Returns
|
protected
array
|
#
sendMultiple( array $requests )
Send multiple requests in parallel
Send multiple requests in parallel
Parameters
- $requests
- Array of RequestInterface objects
Returns
array Returns an array of Response objects
|
protected
Guzzle\Http\Message\RequestInterface
|
#
prepareRequest( Guzzle\Http\Message\RequestInterface $request, array $options = array() )
Prepare a request to be sent from the Client by adding client specific behaviors and properties to the request.
Prepare a request to be sent from the Client by adding client specific behaviors and properties to the request.
Parameters
- $request
- Request to prepare for the client
- $options
- Options to apply to the request
Returns
|
protected
|
|
public
|
|