PHP Класс SimpleHttpResponse, simpletest

Наследование: extends SimpleStickyError
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( SimpleSocket $socket, SimpleUrl $url, mixed $encoding ) Constructor. Reads and parses the incoming content and headers.
getContent ( ) : string Accessor for the content after the last header line.
getHeaders ( ) : SimpleHttpHeaders Accessor for header block. The response is the combination of this and the content.
getMethod ( ) : string Original request method.
getNewCookies ( ) : array Accessor for any new cookies.
getRequestData ( ) : mixed Original request data.
getSent ( ) : string Raw request that was sent down the wire.
getUrl ( ) : SimpleUrl Resource name.

Защищенные методы

Метод Описание
isLastPacket ( string $packet ) : boolean Test to see if the packet from the socket is the last one.
parse ( string $raw ) Splits up the headers and the rest of the content.
readAll ( SimpleSocket $socket ) : string Reads the whole of the socket output into a single string.

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

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

Constructor. Reads and parses the incoming content and headers.
public __construct ( SimpleSocket $socket, SimpleUrl $url, mixed $encoding )
$socket SimpleSocket Network connection to fetch response text from.
$url SimpleUrl Resource name.
$encoding mixed Record of content sent.

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

Accessor for the content after the last header line.
public getContent ( ) : string
Результат string All content.

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

Accessor for header block. The response is the combination of this and the content.
public getHeaders ( ) : SimpleHttpHeaders
Результат SimpleHttpHeaders Wrapped header block.

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

Original request method.
public getMethod ( ) : string
Результат string GET, POST or HEAD.

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

Accessor for any new cookies.
public getNewCookies ( ) : array
Результат array List of new cookies.

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

Original request data.
public getRequestData ( ) : mixed
Результат mixed Sent content.

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

Raw request that was sent down the wire.
public getSent ( ) : string
Результат string Bytes actually sent.

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

Resource name.
public getUrl ( ) : SimpleUrl
Результат SimpleUrl Current url.

isLastPacket() защищенный Метод

Test to see if the packet from the socket is the last one.
protected isLastPacket ( string $packet ) : boolean
$packet string Chunk to interpret.
Результат boolean True if empty or EOF.

parse() защищенный Метод

Splits up the headers and the rest of the content.
protected parse ( string $raw )
$raw string Content to parse.

readAll() защищенный Метод

Reads the whole of the socket output into a single string.
protected readAll ( SimpleSocket $socket ) : string
$socket SimpleSocket Unread socket.
Результат string Raw output if successful else false.