Ark Server API (ASE) - Wiki
|
#include <HTTPMessage.h>
Public Member Functions | |
void | setVersion (const std::string &version) |
const std::string & | getVersion () const |
Sets the HTTP version for this message. | |
void | setContentLength (std::streamsize length) |
Returns the HTTP version for this message. | |
std::streamsize | getContentLength () const |
bool | hasContentLength () const |
void | setTransferEncoding (const std::string &transferEncoding) |
Returns true iff a Content-Length header is present. | |
const std::string & | getTransferEncoding () const |
void | setChunkedTransferEncoding (bool flag) |
bool | getChunkedTransferEncoding () const |
void | setContentType (const std::string &mediaType) |
void | setContentType (const MediaType &mediaType) |
const std::string & | getContentType () const |
Sets the content type for this message. | |
void | setKeepAlive (bool keepAlive) |
bool | getKeepAlive () const |
Public Member Functions inherited from Poco::Net::NameValueCollection | |
NameValueCollection () | |
NameValueCollection (const NameValueCollection &nvc) | |
Creates an empty NameValueCollection. | |
NameValueCollection (NameValueCollection &&nvc) noexcept | |
Creates a NameValueCollection by copying another one. | |
virtual | ~NameValueCollection () |
Creates a NameValueCollection by moving another one. | |
NameValueCollection & | operator= (const NameValueCollection &nvc) |
Destroys the NameValueCollection. | |
NameValueCollection & | operator= (NameValueCollection &&nvc) noexcept |
Assigns the name-value pairs of another NameValueCollection to this one. | |
void | swap (NameValueCollection &nvc) |
Moves the name-value pairs of another NameValueCollection to this one. | |
const std::string & | operator[] (const std::string &name) const |
Swaps the NameValueCollection with another one. | |
void | set (const std::string &name, const std::string &value) |
void | add (const std::string &name, const std::string &value) |
Sets the value of the (first) name-value pair with the given name. | |
const std::string & | get (const std::string &name) const |
Adds a new name-value pair with the given name and value. | |
const std::string & | get (const std::string &name, const std::string &defaultValue) const |
bool | has (const std::string &name) const |
ConstIterator | find (const std::string &name) const |
ConstIterator | begin () const |
ConstIterator | end () const |
bool | empty () const |
std::size_t | size () const |
Returns true iff the header does not have any content. | |
void | erase (const std::string &name) |
void | clear () |
Removes all name-value pairs with the given name. | |
Static Public Attributes | |
static const std::string | HTTP_1_0 |
static const std::string | HTTP_1_1 |
static const std::string | IDENTITY_TRANSFER_ENCODING |
static const std::string | CHUNKED_TRANSFER_ENCODING |
static const int | UNKNOWN_CONTENT_LENGTH |
static const std::string | UNKNOWN_CONTENT_TYPE |
static const std::string | CONTENT_LENGTH |
static const std::string | CONTENT_TYPE |
static const std::string | TRANSFER_ENCODING |
static const std::string | CONNECTION |
static const std::string | PROXY_CONNECTION |
static const std::string | CONNECTION_KEEP_ALIVE |
static const std::string | CONNECTION_CLOSE |
static const std::string | EMPTY |
Protected Member Functions | |
HTTPMessage () | |
HTTPMessage (const std::string &version) | |
Creates the HTTPMessage with version HTTP/1.0. | |
HTTPMessage (const HTTPMessage &other) | |
HTTPMessage & | operator= (const HTTPMessage &other) |
Copy constructor. | |
virtual | ~HTTPMessage () |
Assignment operator. | |
Private Attributes | |
std::string | _version |
Destroys the HTTPMessage. | |
Additional Inherited Members | |
Public Types inherited from Poco::Net::NameValueCollection | |
using | HeaderMap = Poco::ListMap<std::string, std::string> |
using | Iterator = HeaderMap::Iterator |
using | ConstIterator = HeaderMap::ConstIterator |
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 32 of file HTTPMessage.h.
|
protected |
|
protected |
Creates the HTTPMessage with version HTTP/1.0.
|
protected |
Creates the HTTPMessage and sets the version.
|
protectedvirtual |
Assignment operator.
bool Poco::Net::HTTPMessage::getChunkedTransferEncoding | ( | ) | const |
If flag is true, sets the Transfer-Encoding header to chunked. Otherwise, removes the Transfer-Encoding header.
std::streamsize Poco::Net::HTTPMessage::getContentLength | ( | ) | const |
Sets the Content-Length header.
If length is UNKNOWN_CONTENT_LENGTH, removes the Content-Length header.
const std::string & Poco::Net::HTTPMessage::getContentType | ( | ) | const |
Sets the content type for this message.
bool Poco::Net::HTTPMessage::getKeepAlive | ( | ) | const |
Sets the value of the Connection header field.
The value is set to "Keep-Alive" if keepAlive is true, or to "Close" otherwise.
const std::string & Poco::Net::HTTPMessage::getTransferEncoding | ( | ) | const |
Sets the transfer encoding for this message.
The value should be either IDENTITY_TRANSFER_CODING or CHUNKED_TRANSFER_CODING.
|
inline |
Sets the HTTP version for this message.
Definition at line 174 of file HTTPMessage.h.
|
inline |
Returns the content length for this message, which may be UNKNOWN_CONTENT_LENGTH if no Content-Length header is present.
Definition at line 180 of file HTTPMessage.h.
|
protected |
Copy constructor.
void Poco::Net::HTTPMessage::setChunkedTransferEncoding | ( | bool | flag | ) |
Returns the transfer encoding used for this message.
Normally, this is the value of the Transfer-Encoding header field. If no such field is present, returns IDENTITY_TRANSFER_CODING.
void Poco::Net::HTTPMessage::setContentLength | ( | std::streamsize | length | ) |
Returns the HTTP version for this message.
void Poco::Net::HTTPMessage::setContentType | ( | const MediaType & | mediaType | ) |
Sets the content type for this message.
Specify UNKNOWN_CONTENT_TYPE to remove the Content-Type header.
void Poco::Net::HTTPMessage::setContentType | ( | const std::string & | mediaType | ) |
Returns true if the Transfer-Encoding header is set and its value is chunked.
void Poco::Net::HTTPMessage::setKeepAlive | ( | bool | keepAlive | ) |
Returns the content type for this message.
If no Content-Type header is present, returns UNKNOWN_CONTENT_TYPE.
void Poco::Net::HTTPMessage::setTransferEncoding | ( | const std::string & | transferEncoding | ) |
Returns true iff a Content-Length header is present.
void Poco::Net::HTTPMessage::setVersion | ( | const std::string & | version | ) |
|
private |
Destroys the HTTPMessage.
Definition at line 167 of file HTTPMessage.h.
|
static |
Definition at line 133 of file HTTPMessage.h.
|
static |
Definition at line 141 of file HTTPMessage.h.
|
static |
Definition at line 145 of file HTTPMessage.h.
|
static |
Definition at line 144 of file HTTPMessage.h.
|
static |
Definition at line 138 of file HTTPMessage.h.
|
static |
Definition at line 139 of file HTTPMessage.h.
|
static |
Definition at line 147 of file HTTPMessage.h.
|
static |
Returns true if
Definition at line 129 of file HTTPMessage.h.
|
static |
Definition at line 130 of file HTTPMessage.h.
|
static |
Definition at line 132 of file HTTPMessage.h.
|
static |
Definition at line 142 of file HTTPMessage.h.
|
static |
Definition at line 140 of file HTTPMessage.h.
|
static |
Definition at line 135 of file HTTPMessage.h.
|
static |
Definition at line 136 of file HTTPMessage.h.