HTTPRequest


Derived from: HTTPMessage

Declared in: HTTPMessage.h

Library: libHTTP.so


Overview


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


Constructor and Destructor



	HTTPRequest( void )

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


~HTTPRequest()


	virtual ~HTTPRequest( void )

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


Member Functions


SetRequestLine()


	void SetRequestLine( const char *requestLine )
	void SetRequestLine( const char *method, const char *uri )
	void SetRequestLine( http_method method, brokenURI *uri )

Set the request-line of the message. The first form accepts a full request-line of the form: method SP URI [SP http-version]. The second form accepts a method and uri string and creates the request-line for you. The final form accepts a http_request type and a brokenURI. It constructs the request-line for your from the arguments you provided.

All versions interpret the request line by setting the method and version attributes.


GetRequestLine()


	const char *GetRequestLine( void )
	void GetRequestLine( char *method, char *uri, char *version )

Returns HTTPMessage::GetStartLine().


GetMethod()


	http_method GetMethod( void )

Returns the method of the request.


ParseURI()


	void ParseURI( brokenURI *uri )

Parses the URI in the request-line and outputs its components to uri. See parse_URI() in the Functions section of this documentation.


SetReplyIO(), GetReplyIO()


	void SetReplyIO( BDataIO *replyIO )
	BDataIO *GetReplyIO( void )

Sets and gets the BDataIO object used for transport when SendReply() is called.


SetPort(), GetPort()


	void SetPort( unsigned short port )
	unsigned short GetPort( void )

Set and get the TCP port on which this message was received. They are for informational use only and do not have any effect on the message. They are provided for use with CGIs, which like to know the port which was used.


SetRemoteHost(), GetRemoteHost()


	void SetRemoteHost( const char *remoteHost )
	const char *GetRemoteHost( void )

Set and get the remote host name of the machine responsible for the request. They are for informational use only and do not have any effect on the message. They are provided for use with CGIs, which like to know the remote host name.


ReceiveMessage()


	virtual int32 ReceiveMessage( BDataIO *io )

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


SendReply()


	virtual int32 SendReply( HTTPResponse *response )

Send a response back to network entity which initiated this request. Calls response->SendMessage( GetReplyIO(), simple ), where simple is set to true when this request is a simple request.


libHTTP - A high-level HTTP API for the BeOS


Copyright (C) 1999 Joe Kloss