this is a microservice for managing REST-requests, used for non-qt applications.
More...
#include <mitkRESTManager.h>
|
| RESTManager () |
|
| ~RESTManager () override |
|
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={}) override |
| Executes a HTTP request in the mitkRESTClient class. More...
|
|
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={}) override |
| Executes a HTTP request in the mitkRESTClient class. More...
|
|
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={}) override |
| Executes a HTTP request in the mitkRESTClient class. More...
|
|
void | ReceiveRequest (const web::uri &uri, IRESTObserver *observer) override |
| starts listening for requests if there isn't another observer listening and the port is free More...
|
|
web::http::http_response | Handle (const web::uri &uri, const web::json::value &body, const web::http::method &method, const mitk::RESTUtil::ParamMap &headers) override |
| Handles incoming requests by notifying the observer which should receive it. More...
|
|
void | HandleDeleteObserver (IRESTObserver *observer, const web::uri &uri={}) override |
| Handles the deletion of an observer for all or a specific uri. More...
|
|
const std::map< int, RESTServer * > & | GetServerMap () override |
| internal use only More...
|
|
std::map< std::pair< int, utility::string_t >, IRESTObserver * > & | GetObservers () override |
|
virtual | ~IRESTManager () |
|
this is a microservice for managing REST-requests, used for non-qt applications.
RESTManagerQt in the CppRestSdkQt module inherits from this class and is the equivalent microservice used for Qt applications.
Definition at line 29 of file mitkRESTManager.h.
◆ RESTManager()
mitk::RESTManager::RESTManager |
( |
| ) |
|
◆ ~RESTManager()
mitk::RESTManager::~RESTManager |
( |
| ) |
|
|
override |
◆ GetObservers()
std::map<std::pair<int, utility::string_t>, IRESTObserver *>& mitk::RESTManager::GetObservers |
( |
| ) |
|
|
overridevirtual |
◆ GetServerMap()
const std::map<int, RESTServer *>& mitk::RESTManager::GetServerMap |
( |
| ) |
|
|
overridevirtual |
◆ Handle()
web::http::http_response mitk::RESTManager::Handle |
( |
const web::uri & |
uri, |
|
|
const web::json::value & |
body, |
|
|
const web::http::method & |
method, |
|
|
const mitk::RESTUtil::ParamMap & |
headers |
|
) |
| |
|
overridevirtual |
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
Implements mitk::IRESTManager.
◆ HandleDeleteObserver()
void mitk::RESTManager::HandleDeleteObserver |
( |
IRESTObserver * |
observer, |
|
|
const web::uri & |
uri = {} |
|
) |
| |
|
overridevirtual |
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) |
Implements mitk::IRESTManager.
◆ ReceiveRequest()
void mitk::RESTManager::ReceiveRequest |
( |
const web::uri & |
uri, |
|
|
IRESTObserver * |
observer |
|
) |
| |
|
overridevirtual |
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 |
Implements mitk::IRESTManager.
◆ SendBinaryRequest()
pplx::task<web::json::value> mitk::RESTManager::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 = {} |
|
) |
| |
|
overridevirtual |
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) |
body | the body for the request (optional) |
headers | the headers for the request (optional) |
- Returns
- task to wait for
Implements mitk::IRESTManager.
◆ SendJSONRequest()
pplx::task<web::json::value> mitk::RESTManager::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 = {} |
|
) |
| |
|
overridevirtual |
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) |
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
Implements mitk::IRESTManager.
◆ SendRequest()
pplx::task<web::json::value> mitk::RESTManager::SendRequest |
( |
const web::uri & |
uri, |
|
|
const RequestType & |
type = RequestType::Get , |
|
|
const std::map< utility::string_t, utility::string_t > |
headers = {} |
|
) |
| |
|
overridevirtual |
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
Implements mitk::IRESTManager.
The documentation for this class was generated from the following file: