Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • 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
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP

Classes

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

Interfaces

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

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, Guzzle\Tests\Service\Mock\MockClient
Namespace: Guzzle\Http
Located at src/Guzzle/Http/ClientInterface.php
Methods summary
public Guzzle\Http\ClientInterface
# 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

Guzzle\Http\ClientInterface
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

mixed|Guzzle\Common\Collection

See

\Guzzle\Http\Message\RequestFactoryInterface::applyOptions for a full list of request.options options
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, array $options = array() )

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
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

Guzzle\Http\Message\RequestInterface

Throws

InvalidArgumentException

if a URI array is passed that does not contain exactly two elements: the URI followed by template variables

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

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, 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

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, 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

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, 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

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, 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

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, 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

Guzzle\Http\Message\EntityEnclosingRequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
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

Guzzle\Http\Message\RequestInterface

See

Guzzle\Http\ClientInterface::createRequest()
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

Guzzle\Http\Message\Response|array
Returns a single Response or an array of Response objects
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
public Guzzle\Http\ClientInterface
# 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

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
User agent string
$includeDefault
Set to true to prepend the value to Guzzle's default user agent string

Returns

Guzzle\Http\ClientInterface
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 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

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'
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen