PHP Class SparkPost\SparkPostResponse

Inheritance: implements Psr\Http\Message\ResponseInterface
Afficher le fichier Open project: sparkpost/php-sparkpost Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

getBody() public méthode

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

getHeader() public méthode

public getHeader ( $name )

getHeaderLine() public méthode

public getHeaderLine ( $name )

getHeaders() public méthode

public getHeaders ( )

getProtocolVersion() public méthode

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

getReasonPhrase() public méthode

public getReasonPhrase ( )

getStatusCode() public méthode

public getStatusCode ( )

hasHeader() public méthode

public hasHeader ( $name )

withAddedHeader() public méthode

public withAddedHeader ( $name, $value )

withBody() public méthode

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

withHeader() public méthode

public withHeader ( $name, $value )

withProtocolVersion() public méthode

public withProtocolVersion ( $version )

withStatus() public méthode

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

withoutHeader() public méthode

public withoutHeader ( $name )