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

Public Member Functions

cloe::RequestMethod method () const override
 
cloe::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
 

Member Function Documentation

◆ body()

const std::string& oak::RequestStub::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::RequestStub::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()

cloe::RequestMethod oak::RequestStub::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::RequestStub::query_map ( ) const
inlineoverridevirtual

Returns a key-value map of the query parameters.

Implements cloe::Request.

◆ type()

cloe::ContentType oak::RequestStub::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::RequestStub::uri ( ) const
inlineoverridevirtual

Returns the path, including query string.

Implements cloe::Request.


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