RHTTPMessage Class Reference

#include <mw/http/rhttpmessage.h>

Link against: http.lib

class RHTTPMessage
Protected Attributes
CMessage *iImplementation
Public Member Functions
RHTTPMessage()
IMPORT_C MHTTPDataSupplier *Body()
IMPORT_C RHTTPHeadersGetHeaderCollection()
IMPORT_C TBoolHasBody()
IMPORT_C voidRemoveBody()
IMPORT_C voidSetBody(MHTTPDataSupplier &)

Detailed Description

An abstract HTTP message. In RFC2616, an HTTP message is defined as having a header and an optional body. This class is specialised for HTTP requests and responses.

Member Attribute Documentation

iImplementation

CMessage *iImplementation[protected]

Constructor & Destructor Documentation

RHTTPMessage ( )

RHTTPMessage()[inline]

Member Function Documentation

Body ( )

IMPORT_C MHTTPDataSupplier *Body()const

Gets the body. The body is supplied as a MHTTPDataSupplier, which can be used to return the current data chunk, and to acknowledge when that chunk has been consumed by the client.

Note that the client can assume the body object will remain unchanged from when it receives the first data until the end of the transaction.

Return Value
A data supplier that provides access to a body data chunk. NULL if the body has not been set, or has been removed

GetHeaderCollection ( )

IMPORT_C RHTTPHeadersGetHeaderCollection()

Returns the header collection for the message

HasBody ( )

IMPORT_C TBoolHasBody()const

Determine whether this message has any associated body data.

Return Value
ETrue if there is some body data, EFalse if not.

RemoveBody ( )

IMPORT_C voidRemoveBody()

Removes the body

SetBody ( MHTTPDataSupplier & )

IMPORT_C voidSetBody(MHTTPDataSupplier &aBody)

Sets the messages body, replacing any existing body. The body is supplied as a MHTTPDataSupplier, which will then return the data in 1 or more chunks on request.

Parameters
aBodyThe data supplier that will supply the body.