dodo  0.0.1
A C++ library to create containerized Linux services
dodo::network::protocol::http::HTTPRequest::HTTPRequestLine Class Reference

HTTPRequestLine class. More...

#include <httprequest.hpp>

Inheritance diagram for dodo::network::protocol::http::HTTPRequest::HTTPRequestLine:
Collaboration diagram for dodo::network::protocol::http::HTTPRequest::HTTPRequestLine:

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

- Public Types inherited from dodo::network::protocol::http::HTTPFragment
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 Public Member Functions inherited from dodo::network::protocol::http::HTTPFragment
static std::string getParseResultAsString (ParseError error)
 Return the string description of a ParseError. More...
 

Detailed Description

HTTPRequestLine class.

Contains

  • A request method HTTPRequest::Method.
  • A request 'uri' (it is not an uri buth rather a path that could be an URI).
  • A HTTP version

Definition at line 67 of file httprequest.hpp.

Constructor & Destructor Documentation

◆ HTTPRequestLine()

dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::HTTPRequestLine ( )
inline

Construct default HTTPRequestLine.

Definition at line 73 of file httprequest.hpp.

Member Function Documentation

◆ asString()

std::string dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::asString ( ) const
virtual

◆ getHTTPVersion()

HTTPVersion dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::getHTTPVersion ( ) const
inline

Get the HTTP version.

Returns
The HTTP version.

Definition at line 119 of file httprequest.hpp.

References http_version_.

◆ getMethod()

HTTPRequest::Method dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::getMethod ( ) const
inline

Get the HTTPRequest::Method.

Returns
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().

Here is the caller graph for this function:

◆ getRequestURI()

std::string dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::getRequestURI ( ) const
inline

Get the request uri.

Returns
the request uri.

Definition at line 107 of file httprequest.hpp.

References request_uri_.

◆ parse()

◆ setHTTPVersion()

void dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::setHTTPVersion ( const HTTPVersion version)
inline

Set the HTTP version.

Parameters
versionThe HTTP version.

Definition at line 125 of file httprequest.hpp.

References http_version_.

◆ setMethod()

void dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::setMethod ( HTTPRequest::Method  method)
inline

Set the HTTPRequest::Method.

Parameters
methodThe HTTPRequest::Method.

Definition at line 101 of file httprequest.hpp.

References method_.

◆ setRequestURI()

void dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::setRequestURI ( const std::string &  uri)
inline

Set the request uri.

Parameters
uriThe request uri.

Definition at line 113 of file httprequest.hpp.

References request_uri_.

Field Documentation

◆ http_version_

HTTPVersion dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::http_version_
protected

The HTTP version.

Definition at line 142 of file httprequest.hpp.

Referenced by asString(), getHTTPVersion(), and setHTTPVersion().

◆ method_

HTTPRequest::Method dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::method_
protected

The request method.

Definition at line 125 of file httprequest.hpp.

Referenced by asString(), getMethod(), and setMethod().

◆ request_uri_

std::string dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::request_uri_
protected

The request 'uri'.

Definition at line 137 of file httprequest.hpp.

Referenced by asString(), getRequestURI(), and setRequestURI().


The documentation for this class was generated from the following files: