PHP Interface eZ\Bundle\EzPublishRestBundle\Features\Context\RestClient\DriverInterface

Notice: Setters are for request and Getters for response since no assertion is done on requests, and no set is done onto responses
Show file Open project: ezsystems/ezpublish-kernel Interface Usage Examples

Public Methods

Method Description
getBody ( ) : string Get response body.
getHeader ( string $header ) : string Get response header.
getHeaders ( ) : array Get all response headers.
getStatusCode ( ) : string Get response status code.
getStatusMessage ( ) : string Get response status message.
send ( ) Send the request.
setAuthentication ( string $user, string $password, string $type = self::AUTH_TYPE_BASIC ) Set authentication.
setBody ( string $body ) Set request body.
setHeader ( string $header, $value ) Set request header.
setHeaders ( array $headers ) Set request headers.
setHost ( string $host ) Set request host.
setMethod ( string $method ) Set request method.
setResource ( string $resource ) Set request resource url.

Method Details

getBody() public method

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

getHeader() public method

Get response header.
public getHeader ( string $header ) : string
$header string Header to fetch
return string Header value, or a list if its more than one

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)

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

setAuthentication() public method

Set authentication.
public setAuthentication ( string $user, string $password, string $type = self::AUTH_TYPE_BASIC )
$user string
$password string
$type string Authentication type

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

setHeaders() public method

Set request headers.
public setHeaders ( array $headers )
$headers array Associative array with $header => $value (value can be an array if it hasn't a single value)

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