PHP 클래스 SimpleHttpRequest, simpletest

@package SimpleTest
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__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.