Class

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

class GuzzleDriver implements DriverInterface

Methods

__construct()

Instanciate a client.

send()

Send the request.

setHost(string $host)

Set request host.

setResource(string $resource)

Set request resource url.

setMethod(string $method)

Set request method.

string getStatusCode()

Get response status code.

string getStatusMessage()

Get response status message.

setHeader($header, $value)

Set request header.

array getHeaders()

Get all response headers.

string getBody()

Get response body.

setBody(string $body)

Set request body.

Details

at line 67
public __construct()

Instanciate a client.

at line 91
public send()

Send the request.

at line 126
public setHost(string $host)

Set request host.

Parameters

string $host

at line 140
public setResource(string $resource)

Set request resource url.

Parameters

string $resource

at line 150
public setMethod(string $method)

Set request method.

Parameters

string $method Can be GET, POST, PATCH, ...

at line 162
public string getStatusCode()

Get response status code.

Return Value

string

Exceptions

RuntimeException If request hasn't been send already

at line 174
public string getStatusMessage()

Get response status message.

Return Value

string

Exceptions

RuntimeException If request hasn't been send already

at line 184
public setHeader($header, $value)

Set request header.

Parameters

$header
$value

at line 200
public array getHeaders()

Get all response headers.

Return Value

array Associative array with $header => $value (value can be an array if it hasn't a single value)

Exceptions

RuntimeException If request hasn't been send already

at line 218
public string getBody()

Get response body.

Return Value

string

Exceptions

RuntimeException If request hasn't been send already

at line 237
public setBody(string $body)

Set request body.

Parameters

string $body