$darkmode
oak::Request Class Reference
Inheritance diagram for oak::Request:
Collaboration diagram for oak::Request:

Public Member Functions

 Request (const oatpp::web::protocol::http::incoming::Request &req)
 
RequestMethod method () const override
 
ContentType type () const override
 
const std::string & body () const override
 
const std::string & uri () const override
 
const std::string & endpoint () const override
 
const std::map< std::string, std::string > & query_map () const override
 
- Public Member Functions inherited from cloe::Request
virtual bool has_json () const
 
virtual fable::Json as_json () const
 

Detailed Description

Implementation of cloe::Request interface.

Constructor & Destructor Documentation

◆ Request()

oak::Request::Request ( const oatpp::web::protocol::http::incoming::Request &  req)
inlineexplicit

Create a new Request from ServerImpl.

  • This should not panic.

Member Function Documentation

◆ body()

const std::string& oak::Request::body ( ) const
inlineoverridevirtual

Returns the body of the request as a reference to a string.

  • If the request does not contain a body, the return value is an empty string.

Implements cloe::Request.

◆ endpoint()

const std::string& oak::Request::endpoint ( ) const
inlineoverridevirtual

Returns just the endpoint part of the URI.

For example:

https://localhost:8080/cloe/simulation?type=json => /cloe/simulation

Implements cloe::Request.

◆ method()

RequestMethod oak::Request::method ( ) const
inlineoverridevirtual

Returns what method was used on this request, for example GET or POST.

Implements cloe::Request.

◆ query_map()

const std::map<std::string, std::string>& oak::Request::query_map ( ) const
inlineoverridevirtual

Returns a key-value map of the query parameters.

Implements cloe::Request.

◆ type()

ContentType oak::Request::type ( ) const
inlineoverridevirtual

Returns the type, if any, of the content.

Note that the client may not send the right content type for the content. This function checks the Content-Type header, and if that is not set, it may optionally check the body itself.

  • If there is no content, NOT_APPLICABLE is returned.
  • If there is content, but we don't know what kind of data, then UNKNOWN is returned.

Implements cloe::Request.

◆ uri()

const std::string& oak::Request::uri ( ) const
inlineoverridevirtual

Returns the path, including query string.

Implements cloe::Request.


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