HttpRequest

HTTP request class

Constructors

this
this()
Undocumented in source.
this
this(string resource)
Undocumented in source.

Members

Functions

decodePostData
UrlParameters decodePostData()

Decodes submitted form data, and returns an AA of values.

getCookies
string[string] getCookies()

Basic cookie parsing

parseRequestLine
void parseRequestLine(string reqLine)

Parse the first line in a HTTP request ("METHOD /resource HTTP/1.x").

remoteHosts
string[] remoteHosts(string remoteHost)

Get list of hosts as specified in headers (e.g. X-Forwarded-For). First item in returned array is the node furthest away. Duplicates are removed. Specify socket remote address in remoteHost to add it to the list.

Properties

baseURL
string baseURL [@property getter]

Full URL without query parameters or fragment.

host
string host [@property getter]

The hostname, without the port number

host
string host [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
path
string path [@property getter]

Path part of request (until the ?)

port
ushort port [@property getter]

Port number, from Host header (defaults to 80)

port
ushort port [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
protocolDefaultPort
ushort protocolDefaultPort [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
proxyHost
string proxyHost [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
proxyPort
ushort proxyPort [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
queryString
string queryString [@property getter]
string queryString [@property setter]

Query string part of request (atfer the ?)

resource
string resource [@property getter]

Resource part of URL (everything after the hostname)

resource
string resource [@property setter]

Setting the resource to a full URL will fill in the Host header, as well.

root
string root [@property getter]

URL without resource (protocol, host and port).

url
string url [@property getter]

Reconstruct full URL from host, port and resource

urlParameters
UrlParameters urlParameters [@property getter]
UrlParameters urlParameters [@property setter]

AA of query string parameters

Variables

method
string method;
Undocumented in source.
proxy
string proxy;
Undocumented in source.

Inherited Members

From HttpMessage

protocol
string protocol;
Undocumented in source.
protocolVersion
string protocolVersion;
Undocumented in source.
headers
Headers headers;
Undocumented in source.
data
Data[] data;
Undocumented in source.
creationTime
SysTime creationTime;
Undocumented in source.
age
Duration age [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta