Open Journal Systems  3.3.0
Guzzle\Http\ClientInterface Interface Reference
Inheritance diagram for Guzzle\Http\ClientInterface:
Guzzle\Common\HasDispatcherInterface Guzzle\Http\Client Guzzle\Service\ClientInterface Guzzle\Service\Client Guzzle\Service\Client Guzzle\Tests\Service\Mock\MockClient Guzzle\Tests\Service\Mock\MockClient

Public Member Functions

 createRequest ( $method=RequestInterface::GET, $uri=null, $headers=null, $body=null, array $options=array())
 
 delete ($uri=null, $headers=null, $body=null, array $options=array())
 
 get ($uri=null, $headers=null, $options=array())
 
 getBaseUrl ($expand=true)
 
 getConfig ($key=false)
 
 head ($uri=null, $headers=null, array $options=array())
 
 options ($uri=null, array $options=array())
 
 patch ($uri=null, $headers=null, $body=null, array $options=array())
 
 post ($uri=null, $headers=null, $postBody=null, array $options=array())
 
 put ($uri=null, $headers=null, $body=null, array $options=array())
 
 send ($requests)
 
 setBaseUrl ($url)
 
 setConfig ($config)
 
 setSslVerification ($certificateAuthority=true, $verifyPeer=true, $verifyHost=2)
 
 setUserAgent ($userAgent, $includeDefault=false)
 
- Public Member Functions inherited from Guzzle\Common\HasDispatcherInterface
 addSubscriber (EventSubscriberInterface $subscriber)
 
 dispatch ($eventName, array $context=array())
 
 getEventDispatcher ()
 
 setEventDispatcher (EventDispatcherInterface $eventDispatcher)
 

Data Fields

const CREATE_REQUEST = 'client.create_request'
 
const HTTP_DATE = 'D, d M Y H:i:s \G\M\T'
 

Additional Inherited Members

- Static Public Member Functions inherited from Guzzle\Common\HasDispatcherInterface
static getAllEvents ()
 

Detailed Description

Client interface for send HTTP requests

Definition at line 14 of file lib/vendor/guzzle/guzzle/src/Guzzle/Http/ClientInterface.php.

Member Function Documentation

◆ createRequest()

Guzzle\Http\ClientInterface::createRequest (   $method = RequestInterface::GET,
  $uri = null,
  $headers = null,
  $body = null,
array  $options = array() 
)

Create and return a new {

See also
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
string$methodHTTP method. Defaults to GET
string | array$uriResource URI.
array | Collection$headersHTTP headers
string | resource | array | EntityBodyInterface$bodyEntity body of request (POST/PUT) or response (GET)
array$optionsArray of options to apply to the request
Returns
RequestInterface
Exceptions
InvalidArgumentExceptionif a URI array is passed that does not contain exactly two elements: the URI followed by template variables

Implemented in Guzzle\Http\Client.

◆ delete()

Guzzle\Http\ClientInterface::delete (   $uri = null,
  $headers = null,
  $body = null,
array  $options = array() 
)

Create a DELETE request for the client

Parameters
string | array$uriResource URI
array | Collection$headersHTTP headers
string | resource | EntityBodyInterface$bodyBody to send in the request
array$optionsOptions to apply to the request
Returns
EntityEnclosingRequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ get()

Guzzle\Http\ClientInterface::get (   $uri = null,
  $headers = null,
  $options = array() 
)

Create a GET request for the client

Parameters
string | array$uriResource URI
array | Collection$headersHTTP headers
array$optionsOptions 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
RequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ getBaseUrl()

Guzzle\Http\ClientInterface::getBaseUrl (   $expand = true)

Get the client's base URL as either an expanded or raw URI template

Parameters
bool$expandSet to FALSE to get the raw base URL without URI template expansion
Returns
string|null

Implemented in Guzzle\Http\Client.

◆ getConfig()

Guzzle\Http\ClientInterface::getConfig (   $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.

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
bool | string$keyConfiguration 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|Collection
See also
\Guzzle\Http\Message\RequestFactoryInterface::applyOptions for a full list of request.options options

Implemented in Guzzle\Http\Client.

◆ head()

Guzzle\Http\ClientInterface::head (   $uri = null,
  $headers = null,
array  $options = array() 
)

Create a HEAD request for the client

Parameters
string | array$uriResource URI
array | Collection$headersHTTP headers
array$optionsOptions to apply to the request
Returns
RequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ options()

Guzzle\Http\ClientInterface::options (   $uri = null,
array  $options = array() 
)

Create an OPTIONS request for the client

Parameters
string | array$uriResource URI
array$optionsOptions to apply to the request
Returns
RequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ patch()

Guzzle\Http\ClientInterface::patch (   $uri = null,
  $headers = null,
  $body = null,
array  $options = array() 
)

Create a PATCH request for the client

Parameters
string | array$uriResource URI
array | Collection$headersHTTP headers
string | resource | EntityBodyInterface$bodyBody to send in the request
array$optionsOptions to apply to the request
Returns
EntityEnclosingRequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ post()

Guzzle\Http\ClientInterface::post (   $uri = null,
  $headers = null,
  $postBody = null,
array  $options = array() 
)

Create a POST request for the client

Parameters
string | array$uriResource URI
array | Collection$headersHTTP headers
array | Collection | string | EntityBodyInterface$postBodyPOST 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.
array$optionsOptions to apply to the request
Returns
EntityEnclosingRequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ put()

Guzzle\Http\ClientInterface::put (   $uri = null,
  $headers = null,
  $body = null,
array  $options = array() 
)

Create a PUT request for the client

Parameters
string | array$uriResource URI
array | Collection$headersHTTP headers
string | resource | EntityBodyInterface$bodyBody to send in the request
array$optionsOptions to apply to the request
Returns
EntityEnclosingRequestInterface
See also
Guzzle\Http\ClientInterface::createRequest()

Implemented in Guzzle\Http\Client.

◆ send()

Guzzle\Http\ClientInterface::send (   $requests)

Sends a single request or an array of requests in parallel

Parameters
array | RequestInterface$requestsOne or more RequestInterface objects to send
Returns
\Guzzle\Http\Message\Response|array Returns a single Response or an array of Response objects

Implemented in Guzzle\Http\Client.

◆ setBaseUrl()

Guzzle\Http\ClientInterface::setBaseUrl (   $url)

Set the base URL of the client

Parameters
string$urlThe base service endpoint URL of the webservice
Returns
self

Implemented in Guzzle\Http\Client.

◆ setConfig()

Guzzle\Http\ClientInterface::setConfig (   $config)

Set the configuration object to use with the client

Parameters
array | Collection$configParameters that define how the client behaves
Returns
self

Implemented in Guzzle\Http\Client.

◆ setSslVerification()

Guzzle\Http\ClientInterface::setSslVerification (   $certificateAuthority = true,
  $verifyPeer = true,
  $verifyHost = 2 
)

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
string | bool$certificateAuthoritybool, file path, or directory path
bool$verifyPeerFALSE to stop from verifying the peer's certificate.
int$verifyHostSet 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
self

Implemented in Guzzle\Http\Client.

◆ setUserAgent()

Guzzle\Http\ClientInterface::setUserAgent (   $userAgent,
  $includeDefault = false 
)

Set the User-Agent header to be used on all requests from the client

Parameters
string$userAgentUser agent string
bool$includeDefaultSet to true to prepend the value to Guzzle's default user agent string
Returns
self

Implemented in Guzzle\Http\Client.

Field Documentation

◆ CREATE_REQUEST

const Guzzle\Http\ClientInterface::CREATE_REQUEST = 'client.create_request'

◆ HTTP_DATE


The documentation for this interface was generated from the following file: