HTTPResponse


Derived from: HTTPMessage

Declared in: HTTPResponse

Library: libHTTP.so


Overview


This HTTPMessage derived object implements HTTP response-message specific aspects.


Constructor and Destructor


HTTPResponse()


	HTTPResponse( void )

Calls HTTPMessage() and setup any response-message specific attributes.


~HTTPResponse()


	virtual ~HTTPResponse( void )

Deletes the object along with any internally allocated objects like message-headers.


Member Functions


SetStatusLine()


	void SetStatusLine( const char *status )
	void SetStatusLine( int32 statusCode )

Set the status-line of the response. The first form accepts a full status-line of the format: http-version SP response-code SP reason-phrase. The second form uses the provided statusCode to create the status line for you.

The first version will interpret the line to set the status-code attribute.


GetStatusLine()


	const char *GetStatusLine( void )

Returns HTTPMessage::GetStartLine().


SetHTMLMessage()


	void SetHTMLMessage( int32 statusCode, const char *msg = NULL )

Setup a new message with a status-code of statusCode and create an optional temporary message body with a html message. This is usefull for quickly creating an error message with "text/html" content.

The html message is created for you automatically if you don't supply msg and the statusCode is >= 400. You may provide a message yourself by providing a msg string.


GetStatusCode()


	int32 GetStatusCode( void )

Get the numerical status code of the message.


ReceiveMessage()


	virtual int32 ReceiveMessage( BDataIO *io )

Implements the pure-virtual HTTPMessage::ReceiveMessage() method. See HTTPMessage::ReceiveMessage() for more information.


SendMessage()


	virtual int32 SendMessage( BDataIO *io, bool simple = false )

Overrides the default behaviour of HTTPMessage::SendMessage(). See See HTTPMessage::SendMessage() for more information.


libHTTP - A high-level HTTP API for the BeOS


Copyright (C) 1999 Joe Kloss