PHP Class eZ\Bundle\EzPublishRestBundle\Features\Context\RestClient\GuzzleDriver

Inheritance: implements eZ\Bundle\EzPublishRestBundle\Features\Context\RestClient\DriverInterface, use trait DriverHelper
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$body string
$client Guzzle\Http\Client
$headers Associative array with 'header' => 'value'
$host string
$method string
$request Guzzle\Http\Message\Request
$resource string
$response Guzzle\Http\Message\Response
$sent boolean

Public Methods

Method Description
__construct ( ) Instanciate a client.
getBody ( ) : string Get response body.
getHeaders ( ) : array Get all response headers.
getStatusCode ( ) : string Get response status code.
getStatusMessage ( ) : string Get response status message.
send ( ) Send the request.
setBody ( string $body ) Set request body.
setHeader ( string $header, $value ) Set request header.
setHost ( string $host ) Set request host.
setMethod ( string $method ) Set request method.
setResource ( string $resource ) Set request resource url.

Protected Methods

Method Description
getResponse ( ) : Guzzle\Http\Message\Response Get reponse.

Method Details

__construct() public method

Instanciate a client.
public __construct ( )

getBody() public method

Get response body.
public getBody ( ) : string
return string

getHeaders() public method

Get all response headers.
public getHeaders ( ) : array
return array Associative array with $header => $value (value can be an array if it hasn't a single value)

getResponse() protected method

Get reponse.
protected getResponse ( ) : Guzzle\Http\Message\Response
return Guzzle\Http\Message\Response

getStatusCode() public method

Get response status code.
public getStatusCode ( ) : string
return string

getStatusMessage() public method

Get response status message.
public getStatusMessage ( ) : string
return string

send() public method

Send the request.
public send ( )

setBody() public method

Set request body.
public setBody ( string $body )
$body string

setHeader() public method

Set request header.
public setHeader ( string $header, $value )
$header string Header to be set

setHost() public method

Set request host.
public setHost ( string $host )
$host string

setMethod() public method

Set request method.
public setMethod ( string $method )
$method string Can be GET, POST, PATCH, ...

setResource() public method

Set request resource url.
public setResource ( string $resource )
$resource string

Property Details

$body protected property

protected string $body
return string

$client protected property

protected Client,Guzzle\Http $client
return Guzzle\Http\Client

$headers protected property

Associative array with 'header' => 'value'
protected $headers

$host protected property

protected string $host
return string

$method protected property

protected string $method
return string

$request protected property

protected Request,Guzzle\Http\Message $request
return Guzzle\Http\Message\Request

$resource protected property

protected string $resource
return string

$response protected property

protected Response,Guzzle\Http\Message $response
return Guzzle\Http\Message\Response

$sent protected property

protected bool $sent
return boolean