13 #ifndef mitkRESTManager_h
14 #define mitkRESTManager_h
16 #include <MitkRESTServiceExports.h>
44 pplx::task<web::json::value> SendRequest(
47 const std::map<utility::string_t, utility::string_t> headers = {})
override;
60 pplx::task<web::json::value> SendJSONRequest(
const web::uri &uri,
62 const web::json::value *body =
nullptr,
63 const std::map<utility::string_t, utility::string_t> headers = {},
64 const utility::string_t &filePath = {})
override;
76 pplx::task<web::json::value> SendBinaryRequest(
79 const std::vector<unsigned char> *body = {},
80 const std::map<utility::string_t, utility::string_t> headers = {})
override;
88 void ReceiveRequest(
const web::uri &uri,
IRESTObserver *observer)
override;
100 web::http::http_response
Handle(
const web::uri &uri,
101 const web::json::value &body,
102 const web::http::method &method,
111 void HandleDeleteObserver(
IRESTObserver *observer,
const web::uri &uri = {})
override;
116 const std::map<int, RESTServer *> &GetServerMap()
override;
117 std::map<std::pair<int, utility::string_t>,
IRESTObserver *> &GetObservers()
override;
126 void AddObserver(
const web::uri &uri,
IRESTObserver *observer);
134 void RequestForATakenPort(
const web::uri &uri,
IRESTObserver *observer);
144 void SetServerMap(
const int port,
RESTServer *server);
145 void DeleteFromServerMap(
const int port);
146 void SetObservers(
const std::pair<int, utility::string_t> key,
IRESTObserver *observer);
148 std::map<int, RESTServer *> m_ServerMap;
149 std::map<std::pair<int, utility::string_t>,
IRESTObserver *> m_Observers;