SimpleTest


SimpleTest\SimpleHttpRequest
http.php at line 399

Class SimpleHttpRequest

SimpleHttpRequest

public class SimpleHttpRequest

HTTP request for a web page. Factory for HttpResponse object.

Subpackage:
WebTester

Constructor Summary

SimpleHttpRequest(SimpleRoute route, string method, SimpleFormEncoding encoding)

Saves the URL ready for fetching.

Method Summary
void

addHeaderLine(string header_line)

Adds a header line to the request.

SimpleHttpResponse

fetch(integer timeout)

Fetches the content and parses the headers.

void

setCookie(SimpleCookie cookie)

Adds a cookie to the request.

Constructor Detail

http.php at line 415

SimpleHttpRequest

public SimpleHttpRequest(SimpleRoute route, string method, SimpleFormEncoding encoding)

Saves the URL ready for fetching.

Parameters:
route - Request route.
method - HTTP request method, usually GET.
encoding - Content to send with request or false.

Method Detail

http.php at line 481

addHeaderLine

public void addHeaderLine(string header_line)

Adds a header line to the request.

Parameters:
header_line - Text of header line.

http.php at line 430

fetch

public SimpleHttpResponse fetch(integer timeout)

Fetches the content and parses the headers.

Parameters:
timeout - Connection timeout.
Returns:
A response which may only have an error.

http.php at line 490

setCookie

public void setCookie(SimpleCookie cookie)

Adds a cookie to the request.

Parameters:
cookie - Additional cookie.

SimpleTest