dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
24 #ifndef dodo_network_protocol_http_httprequest_hpp
25 #define dodo_network_protocol_http_httprequest_hpp
33 namespace network::protocol::http {
82 virtual std::string
asString()
const;
183 virtual std::string
asString()
const;
virtual ParseResult parse(VirtualReadBuffer &data)
Read the HTTPRequest from the socket.
@ meINVALID
The parser was presented an invalid method.
HTTPVersion getHTTPVersion() const
Get the HTTP version.
HTTPRequest::Method method_
The request method.
HTTPRequest class represents a HTTP request.
std::string getRequestURI() const
Get the request uri.
void setMethod(HTTPRequest::Method method)
Set the HTTPRequest::Method.
Interface to read individual bytes whilst the implementation can read from an actual source (such as ...
static Method methodFromString(const std::string &s)
Translate an uppercase string ('GET', "POST', ..) into a Method enum.
virtual std::string asString() const
Convert the HTTPRequestLine to a HTTP string.
HHTP version comprising a major and minor number, convertable from and to string as in HTTP requests.
HTTPRequest::Method getMethod() const
Get the HTTPRequest::Method.
Generic HTTP fragment, either a complete (such as HTTPRequest) or incomplete HTTP fragment (ssuch as ...
virtual common::SystemError send(BaseSocket *socket)
Send this HTTPMessage to the socket.
Method
The HTTP request method.
A C++ platform interface to lean Linux services tailored for containerized deployment.
HTTPRequestLine()
Construct default HTTPRequestLine.
HTTPRequestLine & getRequestLine()
Get the HTTPRequestLine.
Used to convey parsing succces.
static bool methodAllowsBody(Method method)
Return true if the Method allows a body in the message.
Generic HTTPMessage, parent to HTTPRequest and HTTPResponse.
std::string request_uri_
The request 'uri'.
void setHTTPVersion(const HTTPVersion &version)
Set the HTTP version.
static std::string methodAsString(Method method)
Translate a Method enum to a human readable string.
Linux system error primitive to provide a consistent interface to Linux error codes.
common::SystemError write(BaseSocket *socket) const
Write the HTTPRequest to the socket.
HTTPRequestLine request_line_
The HTTPRequestLine of the HTTPRequest.
void setRequestURI(const std::string &uri)
Set the request uri.
HTTPVersion http_version_
The HTTP version.
virtual std::string asString() const
Return the HTTPRequest as a string.
virtual ParseResult parse(VirtualReadBuffer &data)
Parses a HTTPMessage.
virtual ParseResult parseBody(VirtualReadBuffer &data)
Parse a body and resturn it as a single string.
Interface to and common implementation of concrete sockets (Socket, TLSSocket).
void setRequestLine(const HTTPRequestLine &req)
Set the HTTPRequestLine.