This is a microservice interface for managing REST requests.
More...
#include <mitkIRESTManager.h>
|
| virtual | ~IRESTManager () |
| |
| virtual pplx::task< web::json::value > | SendRequest (const web::uri &uri, const RequestType &type=RequestType::Get, const std::map< utility::string_t, utility::string_t > headers={})=0 |
| | Executes a HTTP request in the mitkRESTClient class. More...
|
| |
| virtual pplx::task< web::json::value > | SendJSONRequest (const web::uri &uri, const RequestType &type=RequestType::Get, const web::json::value *body=nullptr, const std::map< utility::string_t, utility::string_t > headers={}, const utility::string_t &filePath={})=0 |
| | Executes a HTTP request in the mitkRESTClient class. More...
|
| |
| virtual pplx::task< web::json::value > | SendBinaryRequest (const web::uri &uri, const RequestType &type=RequestType::Get, const std::vector< unsigned char > *body={}, const std::map< utility::string_t, utility::string_t > headers={})=0 |
| | Executes a HTTP request in the mitkRESTClient class. More...
|
| |
| virtual void | ReceiveRequest (const web::uri &uri, IRESTObserver *observer)=0 |
| | starts listening for requests if there isn't another observer listening and the port is free More...
|
| |
| virtual web::http::http_response | Handle (const web::uri &uri, const web::json::value &body, const web::http::method &method, const mitk::RESTUtil::ParamMap &headers)=0 |
| | Handles incoming requests by notifying the observer which should receive it. More...
|
| |
| virtual void | HandleDeleteObserver (IRESTObserver *observer, const web::uri &uri={})=0 |
| | Handles the deletion of an observer for all or a specific uri. More...
|
| |
| virtual const std::map< int, RESTServer * > & | GetServerMap ()=0 |
| |
| virtual const std::map< std::pair< int, utility::string_t >, IRESTObserver * > & | GetObservers ()=0 |
| |
This is a microservice interface for managing REST requests.
Definition at line 34 of file mitkIRESTManager.h.
◆ RequestType
request type for client requests by calling SendRequest
Definition at line 42 of file mitkIRESTManager.h.
◆ ~IRESTManager()
| virtual mitk::IRESTManager::~IRESTManager |
( |
| ) |
|
|
virtual |
◆ GetObservers()
| virtual const std::map<std::pair<int, utility::string_t>, IRESTObserver *>& mitk::IRESTManager::GetObservers |
( |
| ) |
|
|
pure virtual |
◆ GetServerMap()
| virtual const std::map<int, RESTServer *>& mitk::IRESTManager::GetServerMap |
( |
| ) |
|
|
pure virtual |
◆ Handle()
| virtual web::http::http_response mitk::IRESTManager::Handle |
( |
const web::uri & |
uri, |
|
|
const web::json::value & |
body, |
|
|
const web::http::method & |
method, |
|
|
const mitk::RESTUtil::ParamMap & |
headers |
|
) |
| |
|
pure virtual |
Handles incoming requests by notifying the observer which should receive it.
- Parameters
-
| uri | defines the URI of the request |
| body | the body of the request |
| method | the http method of the request |
| headers | the http headers of the request |
- Returns
- the response
Implemented in mitk::RESTManager.
◆ HandleDeleteObserver()
| virtual void mitk::IRESTManager::HandleDeleteObserver |
( |
IRESTObserver * |
observer, |
|
|
const web::uri & |
uri = {} |
|
) |
| |
|
pure virtual |
Handles the deletion of an observer for all or a specific uri.
- Parameters
-
| observer | the observer which shouldn't receive requests anymore |
| uri | the uri for which the observer doesn't handle requests anymore (optional) |
Implemented in mitk::RESTManager.
◆ ReceiveRequest()
| virtual void mitk::IRESTManager::ReceiveRequest |
( |
const web::uri & |
uri, |
|
|
IRESTObserver * |
observer |
|
) |
| |
|
pure virtual |
starts listening for requests if there isn't another observer listening and the port is free
- Parameters
-
| uri | defines the URI for which incoming requests should be send to the observer |
| observer | the observer which handles the incoming requests |
Implemented in mitk::RESTManager.
◆ SendBinaryRequest()
| virtual pplx::task<web::json::value> mitk::IRESTManager::SendBinaryRequest |
( |
const web::uri & |
uri, |
|
|
const RequestType & |
type = RequestType::Get, |
|
|
const std::vector< unsigned char > * |
body = {}, |
|
|
const std::map< utility::string_t, utility::string_t > |
headers = {} |
|
) |
| |
|
pure virtual |
Executes a HTTP request in the mitkRESTClient class.
- Parameters
-
| uri | defines the URI the request is send to |
| type | the RequestType of the HTTP request (optional) |
| body | the body for the request (optional) |
| headers | the headers for the request (optional) |
- Returns
- task to wait for
Implemented in mitk::RESTManager.
◆ SendJSONRequest()
| virtual pplx::task<web::json::value> mitk::IRESTManager::SendJSONRequest |
( |
const web::uri & |
uri, |
|
|
const RequestType & |
type = RequestType::Get, |
|
|
const web::json::value * |
body = nullptr, |
|
|
const std::map< utility::string_t, utility::string_t > |
headers = {}, |
|
|
const utility::string_t & |
filePath = {} |
|
) |
| |
|
pure virtual |
Executes a HTTP request in the mitkRESTClient class.
- Parameters
-
| uri | defines the URI the request is send to |
| type | the RequestType of the HTTP request (optional) |
| body | the body for the request (optional) |
| headers | the headers for the request (optional) |
| filePath | the file path to store the request to (optional) |
- Returns
- task to wait for
Implemented in mitk::RESTManager.
◆ SendRequest()
| virtual pplx::task<web::json::value> mitk::IRESTManager::SendRequest |
( |
const web::uri & |
uri, |
|
|
const RequestType & |
type = RequestType::Get, |
|
|
const std::map< utility::string_t, utility::string_t > |
headers = {} |
|
) |
| |
|
pure virtual |
Executes a HTTP request in the mitkRESTClient class.
- Exceptions
-
- Parameters
-
| uri | defines the URI the request is send to |
| type | the RequestType of the HTTP request (optional) |
| headers | the headers for the request (optional) |
- Returns
- task to wait for
Implemented in mitk::RESTManager.
The documentation for this class was generated from the following file: