Метод | Описание | |
---|---|---|
__construct ( Psr\Http\Message\ResponseInterface $response, string $returnType, Tebru\Retrofit\Adapter\DeserializerAdapter $deserializerAdapter = null, array $context = [] ) | Constructor | |
body ( ) : mixed | Get the body specified by the Returns annotation | |
getBody ( ) : Psr\Http\Message\StreamInterface | Gets the body of the message. | |
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. | |
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. |
public __construct ( Psr\Http\Message\ResponseInterface $response, string $returnType, Tebru\Retrofit\Adapter\DeserializerAdapter $deserializerAdapter = null, array $context = [] ) | ||
$response | Psr\Http\Message\ResponseInterface | |
$returnType | string | |
$deserializerAdapter | Tebru\Retrofit\Adapter\DeserializerAdapter | |
$context | array |
public getBody ( ) : Psr\Http\Message\StreamInterface | ||
Результат | Psr\Http\Message\StreamInterface | Returns the body as a stream. |
public getHeaderLine ( string $name ) : string | ||
$name | string | Case-insensitive header field name. |
Результат | 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 | ||
Результат | 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 | ||
Результат | string | HTTP protocol version. |
public getReasonPhrase ( ) : string | ||
Результат | string | Reason phrase; must return an empty string if none present. |
public getStatusCode ( ) : integer | ||
Результат | integer | Status code. |
public withAddedHeader ( string $name, string | string[] $value ) : self | ||
$name | string | Case-insensitive header field name to add. |
$value | string | string[] | Header value(s). |
Результат | self |
public withBody ( Psr\Http\Message\StreamInterface $body ) : self | ||
$body | Psr\Http\Message\StreamInterface | Body. |
Результат | self |
public withHeader ( string $name, string | string[] $value ) : self | ||
$name | string | Case-insensitive header field name. |
$value | string | string[] | Header value(s). |
Результат | self |
public withProtocolVersion ( string $version ) : self | ||
$version | string | HTTP protocol version |
Результат | 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. |
Результат | self |
public withoutHeader ( string $name ) : self | ||
$name | string | Case-insensitive header field name to remove. |
Результат | self |