$darkmode
#include <handler.hpp>
Public Member Functions | |
| virtual RequestMethod | method () const =0 |
| virtual ContentType | type () const =0 |
| virtual const std::string & | body () const =0 |
| virtual const std::string & | uri () const =0 |
| virtual const std::string & | endpoint () const =0 |
| virtual const std::map< std::string, std::string > & | query_map () const =0 |
| virtual bool | has_json () const |
| virtual fable::Json | as_json () const |
A Request represents an HTTP request sent by an external client.
This may contain data, for example when the request is a POST request.
|
inlinevirtual |
Helper method that tries to convert the body to a JSON object.
|
pure virtual |
Returns the body of the request as a reference to a string.
Implemented in oak::Request, and oak::RequestStub.
|
pure virtual |
Returns just the endpoint part of the URI.
For example:
https://localhost:8080/cloe/simulation?type=json => /cloe/simulation
Implemented in oak::Request, and oak::RequestStub.
|
inlinevirtual |
Helper method that returns whether the header specifies that there is JSON data.
|
pure virtual |
Returns what method was used on this request, for example GET or POST.
Implemented in oak::Request, and oak::RequestStub.
|
pure virtual |
Returns a key-value map of the query parameters.
Implemented in oak::Request, and oak::RequestStub.
|
pure virtual |
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.
Implemented in oak::Request, and oak::RequestStub.
|
pure virtual |
Returns the path, including query string.
Implemented in oak::Request, and oak::RequestStub.