std::map< AString, AString > AStringMap
A string dictionary, used for key-value pairs.
std::map< AString, AString > cNameValueMap
cHTTPMessage(eKind a_Kind)
size_t GetContentLength(void) const
void SetContentLength(size_t a_ContentLength)
virtual void AddHeader(const AString &a_Key, const AString &a_Value)
Adds a header into the internal map of headers.
AString m_ContentType
Type of the content; parsed by AddHeader(), set directly by SetContentLength()
AStringMap m_Headers
Map of headers, with their keys lowercased.
size_t m_ContentLength
Length of the content that is to be received.
void SetContentType(const AString &a_ContentType)
const AString & GetContentType(void) const
Stores outgoing response headers and serializes them to an HTTP data stream.
cHTTPOutgoingResponse(void)
void AppendToData(AString &a_DataStream) const
Appends the response to the specified datastream - response line and headers.
Provides storage for an incoming HTTP request.
virtual void AddHeader(const AString &a_Key, const AString &a_Value) override
Adds the specified header into the internal list of headers.
const AString & GetMethod(void) const
Returns the method used in the request.
const AString & GetAuthUsername(void) const
Returns the username that the request presented.
void SetUserData(cUserDataPtr a_UserData)
Attaches any kind of data to this request, to be later retrieved by GetUserData().
cUserDataPtr m_UserData
Any data attached to the request by the class client.
cHTTPIncomingRequest(const AString &a_Method, const AString &a_URL)
Creates a new instance of the class, containing the method and URL provided by the client.
std::shared_ptr< cUserData > cUserDataPtr
bool m_AllowKeepAlive
Set to true if the request indicated that it supports keepalives.
AString GetURLPath(void) const
Returns the path part of the URL.
bool DoesAllowKeepAlive(void) const
cUserDataPtr GetUserData(void)
Returns the data attached to this request by the class client.
AString m_Method
Method of the request (GET / PUT / POST / ...)
bool m_HasAuth
Set to true if the request contains auth data that was understood by the parser.
AString m_URL
Full URL of the request.
AString m_AuthUsername
The username used for auth.
const AString & GetAuthPassword(void) const
Returns the password that the request presented.
bool HasAuth(void) const
Returns true if the request has had the Auth header present.
AString m_AuthPassword
The password used for auth.
const AString & GetURL(void) const
Returns the URL used in the request.
Base class for anything that can be used as the UserData for the request.