Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractEntityBodyDecorator
  • CachingEntityBody
  • Client
  • EntityBody
  • IoEmittingEntityBody
  • Mimetypes
  • QueryString
  • ReadLimitEntityBody
  • RedirectPlugin
  • Url

Interfaces

  • ClientInterface
  • EntityBodyInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Interface ClientInterface

Client interface for send HTTP requests

Guzzle\Http\ClientInterface implements Guzzle\Common\HasDispatcherInterface

Direct known implementers

Guzzle\Http\Client, Guzzle\Service\ClientInterface

Indirect known implementers

Guzzle\Service\Client
Namespace: Guzzle\Http
Located at Guzzle/Http/ClientInterface.php
Methods summary
public Guzzle\Http\ClientInterface
# setConfig( array|Guzzle\Common\Collection|string $config )

Set the configuration object to use with the client

Set the configuration object to use with the client

Parameters

$config
array|Guzzle\Common\Collection|string
$config Parameters that define how the client behaves and connects to a webservice. Pass an array or a Collection object.

Returns

Guzzle\Http\ClientInterface
public mixed|Guzzle\Common\Collection
# getConfig( boolean|string $key = false )

Get a configuration setting or all of the configuration settings

Get a configuration setting or all of the configuration settings

Parameters

$key
boolean|string
$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

mixed|Guzzle\Common\Collection
public Guzzle\Http\ClientInterface
# 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 a certificate file location to be used with CURLOPT_CAINFO, or a certificate directory path to be used with the CURLOPT_CAPATH option.

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
string|boolean
$certificateAuthority bool, file path, or directory path
$verifyPeer
boolean
$verifyPeer FALSE to stop cURL from verifying the peer's certificate.
$verifyHost
integer
$verifyHost Set the cURL handle's CURLOPT_SSL_VERIFYHOST option

Returns

Guzzle\Http\ClientInterface
public Guzzle\Common\Collection
# getDefaultHeaders( )

Get the default HTTP headers to add to each request created by the client

Get the default HTTP headers to add to each request created by the client

Returns

Guzzle\Common\Collection
public Guzzle\Http\ClientInterface
# setDefaultHeaders( array|Guzzle\Common\Collection $headers )

Set the default HTTP headers to add to each request created by the client

Set the default HTTP headers to add to each request created by the client

Parameters

$headers
array|Guzzle\Common\Collection
$headers Default HTTP headers

Returns

Guzzle\Http\ClientInterface
public Guzzle\Http\ClientInterface
# setUriTemplate( Guzzle\Parser\UriTemplate\UriTemplateInterface $uriTemplate )

Set the URI template expander to use with the client

Set the URI template expander to use with the client

Parameters

$uriTemplate
Guzzle\Parser\UriTemplate\UriTemplateInterface
$uriTemplate URI template expander

Returns

Guzzle\Http\ClientInterface
public Guzzle\Parser\UriTemplate\UriTemplateInterface
# getUriTemplate( )

Get the URI template expander used by the client

Get the URI template expander used by the client

Returns

Guzzle\Parser\UriTemplate\UriTemplateInterface
public string
# expandTemplate( string $template, array $variables = null )

Expand a URI template using client configuration data

Expand a URI template using client configuration data

Parameters

$template
string
$template URI template to expand
$variables
array
$variables Additional variables to use in the expansion

Returns

string
public Guzzle\Http\Message\RequestInterface
# createRequest( string $method = Guzzle\Http\RequestInterface::GET, string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|array|Guzzle\Http\EntityBodyInterface $body = null )

Create and return a new Guzzle\Http\Message\RequestInterface configured for the client.

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
string
$method HTTP method. Defaults to GET
$uri
string|array
$uri Resource URI.
$headers
array|Guzzle\Common\Collection
$headers HTTP headers
$body
string|resource|array|Guzzle\Http\EntityBodyInterface
$body Entity body of request (POST/PUT) or response (GET)

Returns

Guzzle\Http\Message\RequestInterface

Throws

Guzzle\Common\Exception\InvalidArgumentException
if a URI array is passed that does not contain exactly two elements: the URI followed by template variables
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
boolean
$expand Set to FALSE to get the raw base URL without URI template expansion

Returns

string|null
public Guzzle\Http\ClientInterface
# setBaseUrl( string $url )

Set the base URL of the client

Set the base URL of the client

Parameters

$url
string
$url The base service endpoint URL of the webservice

Returns

Guzzle\Http\ClientInterface
public Guzzle\Http\ClientInterface
# 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
string
$userAgent User agent string
$includeDefault
boolean
$includeDefault Set to true to prepend the value to Guzzle's default user agent string

Returns

Guzzle\Http\ClientInterface
public Guzzle\Http\Message\RequestInterface
# get( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|array|Guzzle\Http\EntityBodyInterface $body = null )

Create a GET request for the client

Create a GET request for the client

Parameters

$uri
string|array
$uri Resource URI
$headers
array|Guzzle\Common\Collection
$headers HTTP headers
$body
string|resource|array|Guzzle\Http\EntityBodyInterface
$body Where to store the response entity body

Returns

Guzzle\Http\Message\RequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public Guzzle\Http\Message\RequestInterface
# head( string|array $uri = null, array|Guzzle\Common\Collection $headers = null )

Create a HEAD request for the client

Create a HEAD request for the client

Parameters

$uri
string|array
$uri Resource URI
$headers
array|Guzzle\Common\Collection
$headers HTTP headers

Returns

Guzzle\Http\Message\RequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public Guzzle\Http\Message\EntityEnclosingRequestInterface
# delete( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|Guzzle\Http\EntityBodyInterface $body = null )

Create a DELETE request for the client

Create a DELETE request for the client

Parameters

$uri
string|array
$uri Resource URI
$headers
array|Guzzle\Common\Collection
$headers HTTP headers
$body
string|resource|Guzzle\Http\EntityBodyInterface
$body Body to send in the request

Returns

Guzzle\Http\Message\EntityEnclosingRequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public Guzzle\Http\Message\EntityEnclosingRequestInterface
# put( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|Guzzle\Http\EntityBodyInterface $body = null )

Create a PUT request for the client

Create a PUT request for the client

Parameters

$uri
string|array
$uri Resource URI
$headers
array|Guzzle\Common\Collection
$headers HTTP headers
$body
string|resource|Guzzle\Http\EntityBodyInterface
$body Body to send in the request

Returns

Guzzle\Http\Message\EntityEnclosingRequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public Guzzle\Http\Message\EntityEnclosingRequestInterface
# patch( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, string|resource|Guzzle\Http\EntityBodyInterface $body = null )

Create a PATCH request for the client

Create a PATCH request for the client

Parameters

$uri
string|array
$uri Resource URI
$headers
array|Guzzle\Common\Collection
$headers HTTP headers
$body
string|resource|Guzzle\Http\EntityBodyInterface
$body Body to send in the request

Returns

Guzzle\Http\Message\EntityEnclosingRequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public Guzzle\Http\Message\EntityEnclosingRequestInterface
# post( string|array $uri = null, array|Guzzle\Common\Collection $headers = null, array|Guzzle\Common\Collection|string|Guzzle\Http\EntityBodyInterface $postBody = null )

Create a POST request for the client

Create a POST request for the client

Parameters

$uri
string|array
$uri Resource URI
$headers
array|Guzzle\Common\Collection
$headers HTTP headers
$postBody
array|Guzzle\Common\Collection|string|Guzzle\Http\EntityBodyInterface
$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.

Returns

Guzzle\Http\Message\EntityEnclosingRequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public Guzzle\Http\Message\RequestInterface
# options( string|array $uri = null )

Create an OPTIONS request for the client

Create an OPTIONS request for the client

Parameters

$uri
string|array
$uri Resource URI

Returns

Guzzle\Http\Message\RequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
public array
# send( array $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
array
$requests Request(s) to send

Returns

array
Returns the response(s)
public Guzzle\Http\ClientInterface
# 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

$curlMulti
Guzzle\Http\Curl\CurlMultiInterface
$curlMulti Multi object

Returns

Guzzle\Http\ClientInterface
public Guzzle\Http\Curl\CurlMultiInterface
# getCurlMulti( )

Get the curl multi object to be used internally by the client for transferring requests.

Get the curl multi object to be used internally by the client for transferring requests.

Returns

Guzzle\Http\Curl\CurlMultiInterface
public Guzzle\Http\ClientInterface
# setRequestFactory( Guzzle\Http\Message\RequestFactoryInterface $factory )

Set the request factory to use with the client when creating requests

Set the request factory to use with the client when creating requests

Parameters

$factory
Guzzle\Http\Message\RequestFactoryInterface
$factory Request factory

Returns

Guzzle\Http\ClientInterface
Methods inherited from Guzzle\Common\HasDispatcherInterface
addSubscriber(), dispatch(), getAllEvents(), getEventDispatcher(), setEventDispatcher()
Constants summary
string CREATE_REQUEST 'client.create_request'
#
string HTTP_DATE 'D, d M Y H:i:s \G\M\T'
#

RFC 1123 HTTP-Date

RFC 1123 HTTP-Date

php-coveralls API documentation generated by ApiGen 2.8.0