Ark Server API (ASE) - Wiki
|
#include <HTTPResponse.h>
Public Member Functions | |
HTTPResponse () | |
HTTPResponse (HTTPStatus status, const std::string &reason) | |
Creates the HTTPResponse with OK status. | |
HTTPResponse (const std::string &version, HTTPStatus status, const std::string &reason) | |
HTTPResponse (HTTPStatus status) | |
HTTPResponse (const std::string &version, HTTPStatus status) | |
HTTPResponse (const HTTPResponse &other) | |
virtual | ~HTTPResponse () |
Creates the HTTPResponse by copying another one. | |
HTTPResponse & | operator= (const HTTPResponse &other) |
Destroys the HTTPResponse. | |
void | setStatus (HTTPStatus status) |
Assignment operator. | |
HTTPStatus | getStatus () const |
void | setStatus (const std::string &status) |
Returns the HTTP status code. | |
void | setReason (const std::string &reason) |
const std::string & | getReason () const |
Sets the HTTP reason phrase. | |
void | setStatusAndReason (HTTPStatus status, const std::string &reason) |
Returns the HTTP reason phrase. | |
void | setStatusAndReason (HTTPStatus status) |
Sets the HTTP status code and reason phrase. | |
void | setDate (const Poco::Timestamp &dateTime) |
Poco::Timestamp | getDate () const |
Sets the Date header to the given date/time value. | |
void | addCookie (const HTTPCookie &cookie) |
Returns the value of the Date header. | |
void | getCookies (std::vector< HTTPCookie > &cookies) const |
void | write (std::ostream &ostr) const |
void | read (std::istream &istr) |
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 Member Functions | |
static const std::string & | getReasonForStatus (HTTPStatus status) |
Private Types | |
enum | Limits { MAX_VERSION_LENGTH = 8 , MAX_STATUS_LENGTH = 3 , MAX_REASON_LENGTH = 512 } |
Private Attributes | |
HTTPStatus | _status |
std::string | _reason |
Additional Inherited Members |
This class encapsulates an HTTP response message.
In addition to the properties common to all HTTP messages, a HTTP response has status code and a reason phrase.
Definition at line 35 of file HTTPResponse.h.
Definition at line 44 of file HTTPResponse.h.
|
private |
Enumerator | |
---|---|
MAX_VERSION_LENGTH | |
MAX_STATUS_LENGTH | |
MAX_REASON_LENGTH |
Definition at line 268 of file HTTPResponse.h.
Poco::Net::HTTPResponse::HTTPResponse | ( | ) |
Poco::Net::HTTPResponse::HTTPResponse | ( | HTTPStatus | status, |
const std::string & | reason ) |
Creates the HTTPResponse with OK status.
Poco::Net::HTTPResponse::HTTPResponse | ( | const std::string & | version, |
HTTPStatus | status, | ||
const std::string & | reason ) |
Creates the HTTPResponse with the given status and reason phrase.
|
explicit |
Creates the HTTPResponse with the given version, status and reason phrase.
Poco::Net::HTTPResponse::HTTPResponse | ( | const std::string & | version, |
HTTPStatus | status ) |
Creates the HTTPResponse with the given status and an appropriate reason phrase.
Poco::Net::HTTPResponse::HTTPResponse | ( | const HTTPResponse & | other | ) |
Creates the HTTPResponse with the given version, status and an appropriate reason phrase.
|
virtual |
Creates the HTTPResponse by copying another one.
void Poco::Net::HTTPResponse::addCookie | ( | const HTTPCookie & | cookie | ) |
Returns the value of the Date header.
void Poco::Net::HTTPResponse::getCookies | ( | std::vector< HTTPCookie > & | cookies | ) | const |
Adds the cookie to the response by adding a Set-Cookie header.
Poco::Timestamp Poco::Net::HTTPResponse::getDate | ( | ) | const |
Sets the Date header to the given date/time value.
|
inline |
Sets the HTTP reason phrase.
Definition at line 289 of file HTTPResponse.h.
|
static |
Reads the HTTP response from the given input stream.
100 Continue responses are ignored.
|
inline |
Sets the HTTP status code.
Does not change the reason phrase.
Definition at line 283 of file HTTPResponse.h.
HTTPResponse & Poco::Net::HTTPResponse::operator= | ( | const HTTPResponse & | other | ) |
Destroys the HTTPResponse.
|
virtual |
Writes the HTTP response to the given output stream.
Reimplemented from Poco::Net::MessageHeader.
void Poco::Net::HTTPResponse::setDate | ( | const Poco::Timestamp & | dateTime | ) |
Sets the HTTP status code and reason phrase.
The reason phrase is set according to the status code.
void Poco::Net::HTTPResponse::setReason | ( | const std::string & | reason | ) |
Sets the HTTP status code.
The string must contain a valid HTTP numerical status code.
void Poco::Net::HTTPResponse::setStatus | ( | const std::string & | status | ) |
Returns the HTTP status code.
void Poco::Net::HTTPResponse::setStatus | ( | HTTPStatus | status | ) |
Assignment operator.
void Poco::Net::HTTPResponse::setStatusAndReason | ( | HTTPStatus | status | ) |
Sets the HTTP status code and reason phrase.
void Poco::Net::HTTPResponse::setStatusAndReason | ( | HTTPStatus | status, |
const std::string & | reason ) |
Returns the HTTP reason phrase.
|
virtual |
Returns a vector with all the cookies set in the response header.
May throw an exception in case of a malformed Set-Cookie header.
Reimplemented from Poco::Net::MessageHeader.
|
private |
Definition at line 276 of file HTTPResponse.h.
|
private |
Definition at line 275 of file HTTPResponse.h.
|
static |
Definition at line 264 of file HTTPResponse.h.
|
static |
Definition at line 206 of file HTTPResponse.h.
|
static |
Definition at line 212 of file HTTPResponse.h.
|
static |
Definition at line 253 of file HTTPResponse.h.
|
static |
Definition at line 222 of file HTTPResponse.h.
|
static |
Definition at line 231 of file HTTPResponse.h.
|
static |
Returns an appropriate reason phrase for the given status code.
Definition at line 201 of file HTTPResponse.h.
|
static |
Definition at line 205 of file HTTPResponse.h.
|
static |
Definition at line 241 of file HTTPResponse.h.
|
static |
Definition at line 239 of file HTTPResponse.h.
|
static |
Definition at line 245 of file HTTPResponse.h.
|
static |
Definition at line 225 of file HTTPResponse.h.
|
static |
Definition at line 216 of file HTTPResponse.h.
|
static |
Definition at line 255 of file HTTPResponse.h.
|
static |
Definition at line 232 of file HTTPResponse.h.
|
static |
Definition at line 240 of file HTTPResponse.h.
|
static |
Definition at line 213 of file HTTPResponse.h.
|
static |
Definition at line 258 of file HTTPResponse.h.
|
static |
Definition at line 251 of file HTTPResponse.h.
|
static |
Definition at line 233 of file HTTPResponse.h.
|
static |
Definition at line 244 of file HTTPResponse.h.
|
static |
Definition at line 259 of file HTTPResponse.h.
|
static |
Definition at line 227 of file HTTPResponse.h.
|
static |
Definition at line 242 of file HTTPResponse.h.
|
static |
Definition at line 215 of file HTTPResponse.h.
|
static |
Definition at line 211 of file HTTPResponse.h.
|
static |
Definition at line 214 of file HTTPResponse.h.
|
static |
Definition at line 261 of file HTTPResponse.h.
|
static |
Definition at line 208 of file HTTPResponse.h.
|
static |
Definition at line 207 of file HTTPResponse.h.
|
static |
Definition at line 228 of file HTTPResponse.h.
|
static |
Definition at line 260 of file HTTPResponse.h.
|
static |
Definition at line 226 of file HTTPResponse.h.
|
static |
Definition at line 252 of file HTTPResponse.h.
|
static |
Definition at line 218 of file HTTPResponse.h.
|
static |
Definition at line 204 of file HTTPResponse.h.
|
static |
Definition at line 210 of file HTTPResponse.h.
|
static |
Definition at line 224 of file HTTPResponse.h.
|
static |
Definition at line 221 of file HTTPResponse.h.
|
static |
Definition at line 234 of file HTTPResponse.h.
|
static |
Definition at line 247 of file HTTPResponse.h.
|
static |
Definition at line 203 of file HTTPResponse.h.
|
static |
Definition at line 229 of file HTTPResponse.h.
|
static |
Definition at line 235 of file HTTPResponse.h.
|
static |
Definition at line 249 of file HTTPResponse.h.
|
static |
Definition at line 230 of file HTTPResponse.h.
|
static |
Definition at line 236 of file HTTPResponse.h.
|
static |
Definition at line 238 of file HTTPResponse.h.
|
static |
Definition at line 209 of file HTTPResponse.h.
|
static |
Definition at line 217 of file HTTPResponse.h.
|
static |
Definition at line 254 of file HTTPResponse.h.
|
static |
Definition at line 202 of file HTTPResponse.h.
|
static |
Definition at line 220 of file HTTPResponse.h.
|
static |
Definition at line 248 of file HTTPResponse.h.
|
static |
Definition at line 223 of file HTTPResponse.h.
|
static |
Definition at line 250 of file HTTPResponse.h.
|
static |
Definition at line 262 of file HTTPResponse.h.
|
static |
Definition at line 243 of file HTTPResponse.h.
|
static |
Definition at line 237 of file HTTPResponse.h.
|
static |
Definition at line 246 of file HTTPResponse.h.
|
static |
Definition at line 219 of file HTTPResponse.h.
|
static |
Definition at line 257 of file HTTPResponse.h.
|
static |
Definition at line 256 of file HTTPResponse.h.
|
static |
Definition at line 265 of file HTTPResponse.h.