HTTPMessage

Members

Functions

constructDirectResponse
void constructDirectResponse(ubyte maj, ubyte min, const int statucode, string statusMsg, int contentLength = 0)

Fill in the fields for a response message header that the server will send directly to the client.

constructDirectResponse
void constructDirectResponse(ubyte maj, ubyte min, int contentLength = 0)

Fill in the fields for a response message header that the server will send directly to the client. This function assumes the status code and status message have already been set on this HTTPMessage object

getDecodedQueryParam
string getDecodedQueryParam(string name)

Get the query parameter with the specified name after percent decoding.

getHeaders
HTTPHeaders getHeaders()

Access the headers (fpreq, fpres)

getPath
string getPath()

Access the path component (fpreq)

getQueryParam
string getQueryParam(string name)

Get the query parameter with the specified name.

getQueryString
string getQueryString()

Access the query component (fpreq)

hasQueryParam
bool hasQueryParam(string name)

Check if query parameter with the specified name exists.

is1xxResponse
bool is1xxResponse()

Returns true if this is a 1xx response.

isHTTP1_0
bool isHTTP1_0()

Returns true if the version of this message is HTTP/1.0

isHTTP1_1
bool isHTTP1_1()

Returns true if the version of this message is HTTP/1.1

isRequest
bool isRequest()

@returns true if this HTTPMessage represents an HTTP request

isResponse
bool isResponse()

@returns true if this HTTPMessage represents an HTTP response

processMaxForwards
int processMaxForwards()

Decrements Max-Forwards header, when present on OPTIONS or logDebug methods.

queryParam
string[string] queryParam()

Get the query parameter with the specified name after percent decoding.

removeQueryParam
void removeQueryParam(string name)

Remove the query parameter with the specified name.

setQueryParam
void setQueryParam(string name, string value)

Sets the query parameter with the specified name to the specified value.

setQueryString
void setQueryString(string query)

Set the query string to the specified value, and recreate the url_.

Properties

chunked
bool chunked [@property setter]

Is this a chunked message? (fpreq, fpresp)

clientAddress
Address clientAddress [@property setter]

Set/Get client address

dstAddress
Address dstAddress [@property setter]

Set/Get destination (vip) address

localIp
string localIp [@property setter]

Set/Get the local IP address

statusCode
ushort statusCode [@property setter]

Access the status code (fpres)

upgraded
bool upgraded [@property setter]

Is this an upgraded message? (fpreq, fpresp)

Structs

Request
struct Request

The 12 standard fields for HTTP messages. Use accessors. An HTTPMessage is either a Request or Response. Once an accessor for either is used, that fixes the type of HTTPMessage. If an access is then used for the other type, a DCHECK will fail.

Meta