Request Class Reference

#include <Pt/Http/Request.h>

HTTP request message.

Inherits Message.

Public Member Functions

 Request (Http::Connection &conn)
 Construct with connection.
 
 Request (Http::Connection &conn, const std::string &url)
 Construct with connection and URL.
 
 Request (Http::Connection &conn, const char *url)
 Construct with connection and URL.
 
std::iostream & body ()
 Returns the body of the message.
 
void clear ()
 Clears all content.
 
void discard ()
 Discards the message body.
 
MessageHeaderheader ()
 Returns the header of the message.
 
const MessageHeaderheader () const
 Returns the header of the message.
 
const std::string & method () const
 Returns the HTTP request method.
 
const std::string & qparams () const
 Returns the HTTP request URL query.
 
void setMethod (const std::string &m)
 Sets the request method.
 
void setMethod (const char *m)
 Sets the request method.
 
void setQParams (const std::string &p)
 Sets the URL query string.
 
void setQParams (const char *p)
 Sets the URL query string.
 
void setUrl (const std::string &u)
 Sets the request URL.
 
void setUrl (const char *u)
 Sets the request URL.
 
const std::string & url () const
 Returns the HTTP request URL.