HTTPMessage

Members

Functions

contentLength
size_t contentLength()

Return the size of the binary body array.

getHeader
string getHeader(const string name)

Get the string value of a single header from the message.

getMessageBody
ubyte[] getMessageBody()

Get the body array for this message.

getMethod
MessageMethod getMethod()

Grab the current method for this message.

getPath
string getPath()

Grab the current associated path of this message.

getStatusCode
ushort getStatusCode()

Get the status code for this message.

getStatusMessage
string getStatusMessage()

Get the current status message for this message.

getVersion
string getVersion()

Get the current HTTP version for this message.

setHeader
HTTPMessage setHeader(const string name, const string value)

Set a header in the map to the value provided.

setHeaders
HTTPMessage setHeaders(const string[string] headers)

Set a number of headers based on a generic map of keys and values.

setMessageBody
HTTPMessage setMessageBody(const ubyte[] body_)

Set the body of this message to an unsigned 8-bit binary value.

setMessageBody
HTTPMessage setMessageBody(const string body_)

Set the body of this message to a string value.

setMethod
HTTPMessage setMethod(const MessageMethod method)

Set the associated message method for this message.

setPath
HTTPMessage setPath(const string path)

Set the path of this message, which will be used if it is a request.

setStatusCode
HTTPMessage setStatusCode(ushort code)

Set the status code of this HTTP message.

setStatusMessage
HTTPMessage setStatusMessage(const string message)

Set the status message of this HTTP message.

setVersion
HTTPMessage setVersion(const string version_)

Set the version of this HTTP message to the string specified.

toString
string toString()

Takes the headers added to the message along with the body and outputs it to a std::string for use in client/server HTTP messages.

Meta