PHP Класс SimpleHttpRequest, simpletest

@package SimpleTest
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( SimpleRoute $route, SimpleFormEncoding $encoding ) Builds the socket request from the different pieces.
addHeaderLine ( string $header_line ) Adds a header line to the request.
fetch ( integer $timeout ) : SimpleHttpResponse Dispatches the content to the route's socket.
getHeaders ( ) : array Get the headers to be sent with the request.
readCookiesFromJar ( SimpleCookieJar $jar, SimpleUrl $url ) Reads all the relevant cookies from the cookie jar.

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

Метод Описание
createResponse ( SimpleSocket $socket ) : SimpleHttpResponse Wraps the socket in a response parser.
dispatchRequest ( SimpleSocket $socket, SimpleFormEncoding $encoding ) Sends the headers.

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

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

These include proxy information, URL, cookies, headers, request method and choice of encoding.
public __construct ( SimpleRoute $route, SimpleFormEncoding $encoding )
$route SimpleRoute Request route.
$encoding SimpleFormEncoding Content to send with request.

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

@param string $header_line Text of full header line.
public addHeaderLine ( string $header_line )
$header_line string

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

Wraps the socket in a response parser.
protected createResponse ( SimpleSocket $socket ) : SimpleHttpResponse
$socket SimpleSocket Responding socket.
Результат SimpleHttpResponse Parsed response object.

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

Sends the headers.
protected dispatchRequest ( SimpleSocket $socket, SimpleFormEncoding $encoding )
$socket SimpleSocket Open socket.
$encoding SimpleFormEncoding Content to send with request.

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

Dispatches the content to the route's socket.
public fetch ( integer $timeout ) : SimpleHttpResponse
$timeout integer Connection timeout.
Результат SimpleHttpResponse A response which may only have an error, but hopefully has a complete web page.

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

Get the headers to be sent with the request.
public getHeaders ( ) : array
Результат array

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

Reads all the relevant cookies from the cookie jar.
public readCookiesFromJar ( SimpleCookieJar $jar, SimpleUrl $url )
$jar SimpleCookieJar Jar to read
$url SimpleUrl Url to use for scope.