Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
this is a microservice for managing REST-requests, used for non-qt applications. More...
#include <mitkRESTManager.h>
Public Member Functions | |
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 > *={}, 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 () |
Additional Inherited Members | |
![]() | |
enum | RequestType { RequestType::Get, RequestType::Post, RequestType::Put } |
request type for client requests by calling SendRequest More... | |
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.
mitk::RESTManager::RESTManager | ( | ) |
Definition at line 21 of file mitkRESTManager.cpp.
|
override |
Definition at line 23 of file mitkRESTManager.cpp.
|
overridevirtual |
Implements mitk::IRESTManager.
Definition at line 191 of file mitkRESTManager.cpp.
References mitk::ImageMappingHelper::map(), and MITK_ERROR.
|
overridevirtual |
internal use only
Implements mitk::IRESTManager.
Definition at line 186 of file mitkRESTManager.cpp.
|
overridevirtual |
Handles incoming requests by notifying the observer which should receive it.
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 |
Implements mitk::IRESTManager.
Definition at line 130 of file mitkRESTManager.cpp.
References MITK_WARN.
|
overridevirtual |
Handles the deletion of an observer for all or a specific uri.
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.
Definition at line 151 of file mitkRESTManager.cpp.
|
overridevirtual |
starts listening for requests if there isn't another observer listening and the port is free
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.
Definition at line 107 of file mitkRESTManager.cpp.
|
overridevirtual |
Executes a HTTP request in the mitkRESTClient class.
mitk::Exception | if RequestType is not suported |
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) |
Implements mitk::IRESTManager.
Definition at line 44 of file mitkRESTManager.cpp.
References MITK_WARN, mitkThrow, and mitk::IRESTManager::Post.
|
overridevirtual |
Executes a HTTP request in the mitkRESTClient class.
mitk::Exception | if RequestType is not suported |
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) |
Implements mitk::IRESTManager.
Definition at line 69 of file mitkRESTManager.cpp.
References mitk::IRESTManager::Get, MITK_WARN, mitkThrow, mitk::IRESTManager::Post, and mitk::IRESTManager::Put.
|
overridevirtual |
Executes a HTTP request in the mitkRESTClient class.
mitk::Exception | if RequestType is not suported |
uri | defines the URI the request is send to |
type | the RequestType of the HTTP request (optional) |
headers | the headers for the request (optional) |
Implements mitk::IRESTManager.
Definition at line 25 of file mitkRESTManager.cpp.
References mitk::IRESTManager::Get, and mitkThrow.