Property | Type | Description | |
---|---|---|---|
$data | mixed |
Property | Type | Description | |
---|---|---|---|
$response | Psr\Http\Message\ResponseInterface |
Method | Description | |
---|---|---|
__construct ( Psr\Http\Message\ResponseInterface $response ) | ||
__get ( string $name ) : mixed | Get the api data from the response as usual. | |
getBody ( ) : Psr\Http\Message\StreamInterface | Gets the body of the message. | |
getData ( ) : mixed | Get the underlying data. | |
getHeader ( string $name ) : string[] | Retrieves a message header value by the given case-insensitive name. | |
getHeaderLine ( string $name ) : string | Retrieves a comma-separated string of the values for a single header. | |
getHeaders ( ) : array | Retrieves all message header values. | |
getProtocolVersion ( ) : string | Retrieves the HTTP protocol version as a string. | |
getReasonPhrase ( ) : string | Gets the response reason phrase associated with the status code. | |
getStatusCode ( ) : integer | Gets the response status code. | |
hasHeader ( string $name ) : boolean | Checks if a header exists by the given case-insensitive name. | |
offsetExists ( mixed $offset ) : boolean | Whether a offset exists | |
offsetGet ( mixed $offset ) : mixed | Offset to retrieve | |
offsetSet ( mixed $offset, mixed $value ) : void | Offset to set | |
offsetUnset ( mixed $offset ) : void | Offset to unset | |
toArray ( ) : array | Return an array of the data. | |
withAddedHeader ( string $name, string | string[] $value ) : self | Return an instance with the specified header appended with the given value. | |
withBody ( Psr\Http\Message\StreamInterface $body ) : self | Return an instance with the specified message body. | |
withHeader ( string $name, string | string[] $value ) : self | Return an instance with the provided value replacing the specified header. | |
withProtocolVersion ( string $version ) : self | Return an instance with the specified HTTP protocol version. | |
withStatus ( integer $code, string $reasonPhrase = '' ) : self | Return an instance with the specified status code and, optionally, reason phrase. | |
withoutHeader ( string $name ) : self | Return an instance without the specified header. |
Method | Description | |
---|---|---|
getDataFromResponse ( Psr\Http\Message\ResponseInterface $response ) : mixed |
public __construct ( Psr\Http\Message\ResponseInterface $response ) | ||
$response | Psr\Http\Message\ResponseInterface |
public getBody ( ) : Psr\Http\Message\StreamInterface | ||
return | Psr\Http\Message\StreamInterface | Returns the body as a stream. |
public getHeaderLine ( string $name ) : string | ||
$name | string | Case-insensitive header field name. |
return | string | A string of values as provided for the given header concatenated together using a comma. If the header does not appear in the message, this method MUST return an empty string. |
public getHeaders ( ) : array | ||
return | array | Returns an associative array of the message's headers. Each key MUST be a header name, and each value MUST be an array of strings for that header. |
public getProtocolVersion ( ) : string | ||
return | string | HTTP protocol version. |
public getReasonPhrase ( ) : string | ||
return | string | Reason phrase; must return an empty string if none present. |
public getStatusCode ( ) : integer | ||
return | integer | Status code. |
public offsetExists ( mixed $offset ) : boolean | ||
$offset | mixed | |
return | boolean |
public offsetUnset ( mixed $offset ) : void | ||
$offset | mixed | |
return | void |
public withAddedHeader ( string $name, string | string[] $value ) : self | ||
$name | string | Case-insensitive header field name to add. |
$value | string | string[] | Header value(s). |
return | self |
public withBody ( Psr\Http\Message\StreamInterface $body ) : self | ||
$body | Psr\Http\Message\StreamInterface | Body. |
return | self |
public withHeader ( string $name, string | string[] $value ) : self | ||
$name | string | Case-insensitive header field name. |
$value | string | string[] | Header value(s). |
return | self |
public withProtocolVersion ( string $version ) : self | ||
$version | string | HTTP protocol version |
return | self |
public withStatus ( integer $code, string $reasonPhrase = '' ) : self | ||
$code | integer | The 3-digit integer result code to set. |
$reasonPhrase | string | The reason phrase to use with the provided status code; if none is provided, implementations MAY use the defaults as suggested in the HTTP specification. |
return | self |
public withoutHeader ( string $name ) : self | ||
$name | string | Case-insensitive header field name to remove. |
return | self |