Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Net::HTTPMessage Class Reference

#include <HTTPMessage.h>

Inheritance diagram for Poco::Net::HTTPMessage:

Poco::Net::MessageHeader Poco::Net::NameValueCollection Poco::Net::HTTPRequest Poco::Net::HTTPResponse Poco::Net::HTTPServerRequest Poco::Net::HTTPServerResponse

List of all members.


Detailed Description

The base class for HTTPRequest and HTTPResponse.

Defines the common properties of all HTTP messages. These are version, content length, content type and transfer encoding.

Definition at line 54 of file HTTPMessage.h.


Public Types

typedef HeaderMap::const_iterator ConstIterator
typedef std::multimap
< std::string, std::string,
ILT > 
HeaderMap
typedef HeaderMap::iterator Iterator

Public Member Functions

void add (const std::string &name, const std::string &value)
 Sets the value of the (first) name-value pair with the given name.
ConstIterator begin () const
void clear ()
 Removes all name-value pairs with the given name.
bool empty () const
ConstIterator end () const
void erase (const std::string &name)
ConstIterator find (const std::string &name) const
const std::string & get (const std::string &name, const std::string &defaultValue) const
const std::string & get (const std::string &name) const
 Adds a new name-value pair with the given name and value.
bool getChunkedTransferEncoding () const
int getContentLength () const
const std::string & getContentType () const
 Sets the content type for this message.
bool getKeepAlive () const
const std::string & getTransferEncoding () const
const std::string & getVersion () const
 Sets the HTTP version for this message.
bool has (const std::string &name) const
const std::string & operator[] (const std::string &name) const
 Swaps the NameValueCollection with another one.
virtual void read (std::istream &istr)
void set (const std::string &name, const std::string &value)
void setChunkedTransferEncoding (bool flag)
void setContentLength (int length)
 Returns the HTTP version for this message.
void setContentType (const MediaType &mediaType)
void setContentType (const std::string &mediaType)
void setKeepAlive (bool keepAlive)
void setTransferEncoding (const std::string &transferEncoding)
void setVersion (const std::string &version)
int size () const
 Returns true iff the header does not have any content.
void swap (NameValueCollection &nvc)
 Assigns the name-value pairs of another NameValueCollection to this one.
virtual void write (std::ostream &ostr) const
 Assigns the content of another MessageHeader.

Static Public Member Functions

static void quote (const std::string &value, std::string &result, bool allowSpace=false)
static void splitElements (const std::string &s, std::vector< std::string > &elements, bool ignoreEmpty=true)
static void splitParameters (const std::string::const_iterator &begin, const std::string::const_iterator &end, NameValueCollection &parameters)
static void splitParameters (const std::string &s, std::string &value, NameValueCollection &parameters)

Static Public Attributes

static const std::string CHUNKED_TRANSFER_ENCODING = "chunked"
static const std::string CONNECTION = "Connection"
static const std::string CONNECTION_CLOSE = "Close"
static const std::string CONNECTION_KEEP_ALIVE = "Keep-Alive"
static const std::string CONTENT_LENGTH = "Content-Length"
static const std::string CONTENT_TYPE = "Content-Type"
static const std::string HTTP_1_0 = "HTTP/1.0"
static const std::string HTTP_1_1 = "HTTP/1.1"
static const std::string IDENTITY_TRANSFER_ENCODING = "identity"
static const std::string TRANSFER_ENCODING = "Transfer-Encoding"
static const int UNKNOWN_CONTENT_LENGTH = -1
static const std::string UNKNOWN_CONTENT_TYPE

Protected Member Functions

 HTTPMessage (const std::string &version)
 Creates the HTTPMessage with version HTTP/1.0.
virtual ~HTTPMessage ()

Private Member Functions

 HTTPMessage (const HTTPMessage &)
 Destroys the HTTPMessage.
HTTPMessageoperator= (const HTTPMessage &)

Private Attributes

std::string _version

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index