PHP Класс Phergie_Plugin_Http_Response, phergie

Автор: Phergie Development Team ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$code string HTTP response code or 0 if no HTTP response was received
$codeStrings array HTTP response strings
$content mixed Content of the response body, decoded for supported content types
$headers array Associative array mapping response header names to their values
$message string Description of the HTTP response code or the error message if no HTTP response was received
$meta array Associative array containing other metadata about the response

Открытые методы

Метод Описание
getCode ( ) : string Returns the HTTP response code.
getCodeAsString ( ) : string Returns the HTTP response code text.
getContent ( ) : mixed Returns the content of the response body.
getHeaders ( string $name = null ) : array | string Returns all response headers or the value of a single specified response header.
getMessage ( ) : string Returns the HTTP response description.
getMeta ( string $name = null ) : array | string | null Returns all metadata or the value of a single specified metadatum.
isError ( ) : boolean Returns whether the response indicates a client- or server-side error.
setCode ( string $code ) : Phergie_Plugin_Http_Response Sets the HTTP response code.
setContent ( mixed $content ) : Phergie_Plugin_Http_Response Sets the content of the response body.
setHeaders ( array $headers ) : Phergie_Plugin_Http_Response Sets the response headers.
setMessage ( string $message ) : Phergie_Plugin_Http_Response Sets the HTTP response description.
setMeta ( array $meta ) : Phergie_Plugin_Http_Response Sets the response metadata.

Описание методов

getCode() публичный Метод

Returns the HTTP response code.
public getCode ( ) : string
Результат string Response code

getCodeAsString() публичный Метод

Returns the HTTP response code text.
public getCodeAsString ( ) : string
Результат string Response code text

getContent() публичный Метод

Returns the content of the response body.
public getContent ( ) : mixed
Результат mixed Response body content, decoded for supported content types

getHeaders() публичный Метод

Returns all response headers or the value of a single specified response header.
public getHeaders ( string $name = null ) : array | string
$name string Optional name of a single header for which the associated value should be returned
Результат array | string Associative array of all header values, a string containing the value of the header indicated by $name if one is set, or null if one is not

getMessage() публичный Метод

Returns the HTTP response description.
public getMessage ( ) : string
Результат string

getMeta() публичный Метод

Returns all metadata or the value of a single specified metadatum.
public getMeta ( string $name = null ) : array | string | null
$name string Optional name of a single metadatum for which the associated value should be returned
Результат array | string | null Associative array of all metadata values, a string containing the value of the metadatum indicated by $name if one is set, or null if one is not

isError() публичный Метод

Returns whether the response indicates a client- or server-side error.
public isError ( ) : boolean
Результат boolean TRUE if the response indicates an error, FALSE otherwise

setCode() публичный Метод

Sets the HTTP response code.
public setCode ( string $code ) : Phergie_Plugin_Http_Response
$code string Response code
Результат Phergie_Plugin_Http_Response Provides a fluent interface

setContent() публичный Метод

Sets the content of the response body.
public setContent ( mixed $content ) : Phergie_Plugin_Http_Response
$content mixed Response body content
Результат Phergie_Plugin_Http_Response Provides a fluent interface

setHeaders() публичный Метод

Sets the response headers.
public setHeaders ( array $headers ) : Phergie_Plugin_Http_Response
$headers array Associative array of response headers indexed by header name
Результат Phergie_Plugin_Http_Response Provides a fluent interface

setMessage() публичный Метод

Sets the HTTP response description.
public setMessage ( string $message ) : Phergie_Plugin_Http_Response
$message string Response description
Результат Phergie_Plugin_Http_Response Provides a fluent interface

setMeta() публичный Метод

Sets the response metadata.
public setMeta ( array $meta ) : Phergie_Plugin_Http_Response
$meta array Associative array of response metadata
Результат Phergie_Plugin_Http_Response Provides a fluent interface

Описание свойств

$code защищенное свойство

HTTP response code or 0 if no HTTP response was received
protected string $code
Результат string

$codeStrings защищенное статическое свойство

HTTP response strings
protected static array $codeStrings
Результат array

$content защищенное свойство

Content of the response body, decoded for supported content types
protected mixed $content
Результат mixed

$headers защищенное свойство

Associative array mapping response header names to their values
protected array $headers
Результат array

$message защищенное свойство

Description of the HTTP response code or the error message if no HTTP response was received
protected string $message
Результат string

$meta защищенное свойство

Associative array containing other metadata about the response
protected array $meta
Результат array