A response to an HTTPRequest generated by an HTTP server. More...
#include <httpresponse.h>
Public Member Functions | |
HTTPResponse () | |
Class constructor. | |
HTTPResponse (const String &ToDecompose) | |
String constructor. More... | |
~HTTPResponse () | |
Class destructor. | |
String | Compose () const |
Creates a completed Message that can be sent across an HTTP connection. More... | |
Boole | Decompose (const String &Message) |
Populates the members of this class with data from a text HTTP Message. More... | |
Boole | Decompose (StringIterator &CurrIt, const StringIterator EndIt) |
Populates the members of this class with data from a text HTTP Message. More... | |
const String & | GetAllowHeader () const |
Gets the Allow Header. More... | |
const String & | GetContentEncodingHeader () const |
Gets the Content-Encoding Header. More... | |
const String & | GetDateHeader () const |
Gets the Date Header. More... | |
const String & | GetResponseDescription () const |
Gets the textual description to explain the status code contained in the response. More... | |
const String & | GetServerHeader () const |
Gets the Server Header. More... | |
Whole | GetStatusCode () const |
Gets the status code explaining the result of a HTTP request. More... | |
void | SetAllowHeader (const String &Allow) |
Sets the Allow Header. More... | |
void | SetContentEncodingHeader (const String &ContentEncoding) |
Sets the Content-Encoding Header. More... | |
void | SetDateHeader (const String &Date) |
Sets the Date Header. More... | |
void | SetResponseDescription (const String &Message) |
Sets the textual description to explain the status code contained in the response. More... | |
void | SetServerHeader (const String &Server) |
Sets the Server Header. More... | |
void | SetStatusCode (const Whole Code) |
Sets the status code explaining the result of a HTTP request. More... | |
Public Member Functions inherited from Mezzanine::Network::HTTPMessage | |
const String & | GetBody () const |
Gets the message body containing additional information. More... | |
const String & | GetConnectionHeader () const |
Gets the Connection Header. More... | |
const String & | GetContentLengthHeader () const |
Gets the Content-Length Header. More... | |
const String & | GetContentTypeHeader () const |
Gets the Content-Type Header. More... | |
const String & | GetField (const String &FieldName) const |
Gets a Name-Value pair for a header field in the message. More... | |
UInt16 | GetHTTPMajorVersion () const |
Gets the major version of this message. More... | |
UInt16 | GetHTTPMinorVersion () const |
Gets the minor version of this message. More... | |
const SimpleVersion & | GetHTTPVersion () const |
Gets both the major and minor version of this message. More... | |
Whole | GetMaxFields () const |
Gets how many header fields can be added to this message during parsing. More... | |
Boole | HasField (const String &FieldName) const |
Checks if this message has the named header field. More... | |
void | RemoveAllFields () |
Removes every field from this message. | |
void | RemoveField (const String &FieldName) |
Removes a specific field from this message by name. More... | |
void | SetBody (const String &Body) |
Sets the message body containing additional information. More... | |
void | SetConnectionHeader (const String &Connection) |
Sets the Connection Header. More... | |
void | SetContentLengthHeader (const String &ContentLength) |
Sets the Content-Length Header. More... | |
void | SetContentTypeHeader (const String &ContentType) |
Sets the Content-Type Header. More... | |
void | SetField (const String &FieldName, const String &FieldValue) |
Sets a Name-Value pair for a header field in the message. More... | |
void | SetHTTPMajorVersion (const UInt16 Major) |
Sets the major version of this message. More... | |
void | SetHTTPMinorVersion (const UInt16 Minor) |
Sets the minor version of this message. More... | |
void | SetHTTPVersion (const SimpleVersion &Version) |
Sets both the major and minor version of this message via SimpleVersion. More... | |
void | SetHTTPVersion (const UInt16 Major, const UInt16 Minor) |
Sets both the major and minor version of this message. More... | |
void | SetMaxFields (const Whole MaxFields) |
Sets how many header fields can be added to this message during parsing. More... | |
Protected Member Functions | |
Boole | ParseHTTPHeader (StringIterator &CurrIt, const StringIterator EndIt) |
Parses the information contained in the Message Header. More... | |
Protected Member Functions inherited from Mezzanine::Network::HTTPMessage | |
HTTPMessage () | |
Blank Constructor. | |
HTTPMessage (const UInt16 VerMajor, const UInt16 VerMinor) | |
UInt Version Constructor. | |
HTTPMessage (const SimpleVersion &Version) | |
Version Constructor. | |
virtual | ~HTTPMessage () |
Class destructor. | |
void | AdvanceToNewline (StringIterator &CurrIt, const StringIterator EndIt) |
Convenience method that will ignore and advance passed all characters until one passed the first newline character detected. More... | |
Boole | GetMessageComponent (StringIterator &CurrIt, const StringIterator EndIt, String &Component) |
Extracts all characters from CurrIt until the first space encountered or EndIt, whichever comes first. More... | |
Boole | ParseHTTPFields (StringIterator &CurrIt, const StringIterator EndIt) |
Parses the HTTP fields from a provided string. More... | |
Boole | ParseHTTPVersion (const String &ToParse) |
Parses the HTTP version from a provided string. More... | |
Protected Attributes | |
Whole | ResponseCode |
The HTTP method to use for the response. More... | |
String | ResponseDescription |
The textual message delivered to explain the status code. More... | |
Protected Attributes inherited from Mezzanine::Network::HTTPMessage | |
Whole | MaxHeaderFields |
The maximum number of allowed header fields in this message. More... | |
String | MessageBody |
The body of the message. More... | |
HeaderFieldContainer | MessageFields |
A container of fields to populate the message header with. More... | |
SimpleVersion | MessageVersion |
The version component for this response. More... | |
Additional Inherited Members | |
Public Types inherited from Mezzanine::Network::HTTPMessage | |
typedef HeaderFieldContainer::const_iterator | ConstHeaderFieldIterator |
Const Iterator type for Header Fields in this class. | |
typedef std::vector< HeaderField > | HeaderFieldContainer |
Container type for Header Fields in this class. | |
typedef HeaderFieldContainer::iterator | HeaderFieldIterator |
Iterator type for Header Fields in this class. | |
typedef String::const_iterator | StringIterator |
Convenience typedef for String iterators. | |
A response to an HTTPRequest generated by an HTTP server.
Definition at line 55 of file httpresponse.h.
Mezzanine::Network::HTTPResponse::HTTPResponse | ( | const String & | ToDecompose | ) |
String constructor.
ToDecompose | The String to construct this response from. |
Definition at line 71 of file httpresponse.cpp.
|
virtual |
Creates a completed Message that can be sent across an HTTP connection.
Implements Mezzanine::Network::HTTPMessage.
Definition at line 115 of file httpresponse.cpp.
Populates the members of this class with data from a text HTTP Message.
Message | The String containing the Message to be decomposed. |
Implements Mezzanine::Network::HTTPMessage.
Definition at line 132 of file httpresponse.cpp.
|
virtual |
Populates the members of this class with data from a text HTTP Message.
Message | The String containing the Message to be decomposed. |
Implements Mezzanine::Network::HTTPMessage.
Definition at line 138 of file httpresponse.cpp.
const String & Mezzanine::Network::HTTPResponse::GetAllowHeader | ( | ) | const |
Gets the Allow Header.
Definition at line 203 of file httpresponse.cpp.
const String & Mezzanine::Network::HTTPResponse::GetContentEncodingHeader | ( | ) | const |
Gets the Content-Encoding Header.
Definition at line 209 of file httpresponse.cpp.
const String & Mezzanine::Network::HTTPResponse::GetDateHeader | ( | ) | const |
Gets the Date Header.
Definition at line 215 of file httpresponse.cpp.
const String & Mezzanine::Network::HTTPResponse::GetResponseDescription | ( | ) | const |
Gets the textual description to explain the status code contained in the response.
Definition at line 194 of file httpresponse.cpp.
const String & Mezzanine::Network::HTTPResponse::GetServerHeader | ( | ) | const |
Gets the Server Header.
Definition at line 221 of file httpresponse.cpp.
Whole Mezzanine::Network::HTTPResponse::GetStatusCode | ( | ) | const |
Gets the status code explaining the result of a HTTP request.
Definition at line 188 of file httpresponse.cpp.
|
protectedvirtual |
Parses the information contained in the Message Header.
CurrIt | An iterator to the current character being processed in the string being parsed. |
EndIt | An iterator to the last character in the string to be parsed. |
Implements Mezzanine::Network::HTTPMessage.
Definition at line 77 of file httpresponse.cpp.
void Mezzanine::Network::HTTPResponse::SetAllowHeader | ( | const String & | Allow | ) |
Sets the Allow Header.
Allow | A comma separated list of HTTP methods that are allowed to be performed on the on the resource located on the responding server. |
Definition at line 200 of file httpresponse.cpp.
void Mezzanine::Network::HTTPResponse::SetContentEncodingHeader | ( | const String & | ContentEncoding | ) |
Sets the Content-Encoding Header.
ContentEncoding | A description of the encoding used on the message body if it were encoded/compressed. |
Definition at line 206 of file httpresponse.cpp.
void Mezzanine::Network::HTTPResponse::SetDateHeader | ( | const String & | Date | ) |
Sets the Date Header.
Date | The time and date of when the server processed the request in UTC. |
Definition at line 212 of file httpresponse.cpp.
void Mezzanine::Network::HTTPResponse::SetResponseDescription | ( | const String & | Message | ) |
Sets the textual description to explain the status code contained in the response.
Message | A String to explain the provided status code. |
Definition at line 191 of file httpresponse.cpp.
void Mezzanine::Network::HTTPResponse::SetServerHeader | ( | const String & | Server | ) |
Sets the Server Header.
Server | Information on the platform/server being used by the server. |
Definition at line 218 of file httpresponse.cpp.
void Mezzanine::Network::HTTPResponse::SetStatusCode | ( | const Whole | Code | ) |
Sets the status code explaining the result of a HTTP request.
Code | The HTTP status code representing the manner of response to a previous HTTP request. |
Definition at line 185 of file httpresponse.cpp.
|
protected |
The HTTP method to use for the response.
Definition at line 60 of file httpresponse.h.
|
protected |
The textual message delivered to explain the status code.
Definition at line 63 of file httpresponse.h.