dodo
0.0.1
A C++ library to create containerized Linux services
|
HTTPRequestLine class. More...
#include <httprequest.hpp>
Public Member Functions | |
HTTPRequestLine () | |
Construct default HTTPRequestLine. More... | |
virtual std::string | asString () const |
Convert the HTTPRequestLine to a HTTP string. More... | |
HTTPVersion | getHTTPVersion () const |
Get the HTTP version. More... | |
HTTPRequest::Method | getMethod () const |
Get the HTTPRequest::Method. More... | |
std::string | getRequestURI () const |
Get the request uri. More... | |
virtual ParseResult | parse (VirtualReadBuffer &data) |
Parses a HTTPMessage. More... | |
void | setHTTPVersion (const HTTPVersion &version) |
Set the HTTP version. More... | |
void | setMethod (HTTPRequest::Method method) |
Set the HTTPRequest::Method. More... | |
void | setRequestURI (const std::string &uri) |
Set the request uri. More... | |
Protected Attributes | |
HTTPVersion | http_version_ |
The HTTP version. More... | |
HTTPRequest::Method | method_ |
The request method. More... | |
std::string | request_uri_ |
The request 'uri'. More... | |
Additional Inherited Members | |
![]() | |
enum | ParseError : unsigned int { peOk = 0, peIncomplete, peSystemError, peExpectCRLF, peUnFinishedToken, peExpectingHeaderColon, peInvalidHeaderFieldValue, peInvalidHeaderListEnd, peInvalidMethod, peInvalidHTTPVersion, peInvalidRequestLine, peInvalidContentLength, peUnexpectedBody, peInvalidTransferEncoding, peInvalidChunkHex, peInvalidLastChunk, peExpectingUnsignedInt } |
Parse results returned by the parse functions. More... | |
![]() | |
static std::string | getParseResultAsString (ParseError error) |
Return the string description of a ParseError. More... | |
HTTPRequestLine class.
Contains
Definition at line 67 of file httprequest.hpp.
|
inline |
Construct default HTTPRequestLine.
Definition at line 73 of file httprequest.hpp.
|
virtual |
Convert the HTTPRequestLine to a HTTP string.
Implements dodo::network::protocol::http::HTTPFragment.
Definition at line 77 of file httprequest.cpp.
References dodo::network::protocol::http::HTTPVersion::asString(), dodo::network::protocol::http::HTTPMessage::charCR, dodo::network::protocol::http::HTTPMessage::charLF, dodo::network::protocol::http::HTTPMessage::charSP, http_version_, method_, dodo::network::protocol::http::HTTPRequest::methodAsString(), and request_uri_.
Referenced by dodo::network::protocol::http::HTTPRequest::asString(), and dodo::network::protocol::http::HTTPRequest::send().
|
inline |
Get the HTTP version.
Definition at line 119 of file httprequest.hpp.
References http_version_.
|
inline |
Get the HTTPRequest::Method.
Definition at line 95 of file httprequest.hpp.
References method_.
Referenced by dodo::network::protocol::http::HTTPRequest::asString(), and dodo::network::protocol::http::HTTPRequest::send().
|
inline |
Get the request uri.
Definition at line 107 of file httprequest.hpp.
References request_uri_.
|
virtual |
Parses a HTTPMessage.
data | The VirtualReadBuffer to read from. |
Implements dodo::network::protocol::http::HTTPFragment.
Definition at line 162 of file httprequest.cpp.
References dodo::network::protocol::http::HTTPMessage::charCR, dodo::network::protocol::http::HTTPMessage::charLF, dodo::network::protocol::http::HTTPMessage::eatSpace(), dodo::common::SystemError::ecOK, dodo::network::VirtualReadBuffer::get(), dodo::network::protocol::http::HTTPRequest::meINVALID, dodo::network::protocol::http::HTTPRequest::methodFromString(), dodo::network::VirtualReadBuffer::next(), dodo::network::protocol::http::HTTPFragment::ParseResult::ok(), dodo::network::protocol::http::HTTPFragment::peExpectCRLF, dodo::network::protocol::http::HTTPFragment::peInvalidMethod, dodo::network::protocol::http::HTTPFragment::peInvalidRequestLine, dodo::network::protocol::http::HTTPFragment::ParseResult::setSystemError(), and throw_SystemException.
Referenced by dodo::network::protocol::http::HTTPRequest::parse().
|
inline |
Set the HTTP version.
version | The HTTP version. |
Definition at line 125 of file httprequest.hpp.
References http_version_.
|
inline |
Set the HTTPRequest::Method.
method | The HTTPRequest::Method. |
Definition at line 101 of file httprequest.hpp.
References method_.
|
inline |
Set the request uri.
uri | The request uri. |
Definition at line 113 of file httprequest.hpp.
References request_uri_.
|
protected |
The HTTP version.
Definition at line 142 of file httprequest.hpp.
Referenced by asString(), getHTTPVersion(), and setHTTPVersion().
|
protected |
The request method.
Definition at line 125 of file httprequest.hpp.
Referenced by asString(), getMethod(), and setMethod().
|
protected |
The request 'uri'.
Definition at line 137 of file httprequest.hpp.
Referenced by asString(), getRequestURI(), and setRequestURI().