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.
 
const std::string & url () const
 Returns the HTTP request URL.
 
void setUrl (const std::string &u)
 Sets the request URL.
 
void setUrl (const char *u)
 Sets the request URL.
 
const std::string & method () const
 Returns the HTTP request method.
 
void setMethod (const std::string &m)
 Sets the request method.
 
void setMethod (const char *m)
 Sets the request method.
 
const std::string & qparams () const
 Returns the HTTP request URL query.
 
void setQParams (const std::string &p)
 Sets the URL query string.
 
void setQParams (const char *p)
 Sets the URL query string.
 
void clear ()
 Clears all content.
 
Connectionconnection ()
 Returns the used connection.
 
MessageHeaderheader ()
 Returns the header of the message.
 
const MessageHeaderheader () const
 Returns the header of the message.
 
std::iostream & body ()
 Returns the body of the message.
 
std::size_t available () const
 Returns the number of bytes available to read.
 
std::size_t pending () const
 Returns the number of bytes pending to be written.
 
void discard ()
 Discards the message body.