PHP Class SparkPost\SparkPostResponse

Inheritance: implements Psr\Http\Message\ResponseInterface
ファイルを表示 Open project: sparkpost/php-sparkpost Class Usage Examples

Public Methods

Method Description
__construct ( Psr\Http\Message\ResponseInterface $response ) set the response to be wrapped.
getBody ( ) : array Returns the body.
getHeader ( $name )
getHeaderLine ( $name )
getHeaders ( )
getProtocolVersion ( ) pass these down to the response given in the constructor.
getReasonPhrase ( )
getStatusCode ( )
hasHeader ( $name )
withAddedHeader ( $name, $value )
withBody ( Psr\Http\Message\StreamInterface $body )
withHeader ( $name, $value )
withProtocolVersion ( $version )
withStatus ( $code, $reasonPhrase = '' )
withoutHeader ( $name )

Method Details

__construct() public method

set the response to be wrapped.
public __construct ( Psr\Http\Message\ResponseInterface $response )
$response Psr\Http\Message\ResponseInterface

getBody() public method

Returns the body.
public getBody ( ) : array
return array $body - the json decoded body from the http response

getHeader() public method

public getHeader ( $name )

getHeaderLine() public method

public getHeaderLine ( $name )

getHeaders() public method

public getHeaders ( )

getProtocolVersion() public method

pass these down to the response given in the constructor.
public getProtocolVersion ( )

getReasonPhrase() public method

public getReasonPhrase ( )

getStatusCode() public method

public getStatusCode ( )

hasHeader() public method

public hasHeader ( $name )

withAddedHeader() public method

public withAddedHeader ( $name, $value )

withBody() public method

public withBody ( Psr\Http\Message\StreamInterface $body )
$body Psr\Http\Message\StreamInterface

withHeader() public method

public withHeader ( $name, $value )

withProtocolVersion() public method

public withProtocolVersion ( $version )

withStatus() public method

public withStatus ( $code, $reasonPhrase = '' )

withoutHeader() public method

public withoutHeader ( $name )