MySQL 8.4.2
Source Code Documentation
RestApiHandler Class Referenceabstract

handler for REST API calls. More...

#include <rest_api_component.h>

Inheritance diagram for RestApiHandler:
[legend]

Public Member Functions

 RestApiHandler (const std::string &require_realm, HttpMethod::Bitset allowed_methods)
 
bool try_handle_request (http::base::Request &req, const std::string &base_path, const std::vector< std::string > &path_matches) override
 try to handle the request. More...
 
virtual bool on_handle_request (http::base::Request &req, const std::string &base_path, const std::vector< std::string > &path_matches)=0
 
- Public Member Functions inherited from BaseRestApiHandler
 BaseRestApiHandler ()=default
 
 BaseRestApiHandler (const BaseRestApiHandler &)=default
 
 BaseRestApiHandler (BaseRestApiHandler &&)=default
 
BaseRestApiHandleroperator= (const BaseRestApiHandler &)=default
 
BaseRestApiHandleroperator= (BaseRestApiHandler &&)=default
 
virtual ~BaseRestApiHandler ()
 

Private Attributes

std::string require_realm_
 
HttpMethod::Bitset allowed_methods_
 

Detailed Description

handler for REST API calls.

  • may require authentication
  • enforces HTTP Methods

Constructor & Destructor Documentation

◆ RestApiHandler()

RestApiHandler::RestApiHandler ( const std::string &  require_realm,
HttpMethod::Bitset  allowed_methods 
)
inline

Member Function Documentation

◆ on_handle_request()

◆ try_handle_request()

bool RestApiHandler::try_handle_request ( http::base::Request req,
const std::string &  base_path,
const std::vector< std::string > &  path_matches 
)
overridevirtual

try to handle the request.

Returns
success
Return values
truerequest has been handled and a response has been sent
falserequest has not been handled (no response has been sent)

Implements BaseRestApiHandler.

Member Data Documentation

◆ allowed_methods_

HttpMethod::Bitset RestApiHandler::allowed_methods_
private

◆ require_realm_

std::string RestApiHandler::require_realm_
private

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