13 #ifndef mitkIRESTManager_h
14 #define mitkIRESTManager_h
18 #include <MitkRESTExports.h>
21 #include <cpprest/json.h>
22 #include <cpprest/uri.h>
23 #include <cpprest/http_client.h>
58 virtual pplx::task<web::json::value> SendRequest(
61 const std::map<utility::string_t, utility::string_t> headers = {}) = 0;
73 virtual pplx::task<web::json::value> SendJSONRequest(
76 const web::json::value *body =
nullptr,
77 const std::map<utility::string_t, utility::string_t> headers = {},
78 const utility::string_t &filePath = {}
90 virtual pplx::task<web::json::value> SendBinaryRequest(
const web::uri &uri,
92 const std::vector<unsigned char> *body = {},
93 const std::map<utility::string_t, utility::string_t> headers = {}) = 0;
101 virtual void ReceiveRequest(
const web::uri &uri, IRESTObserver *observer) = 0;
112 virtual web::http::http_response Handle(
const web::uri &uri,
113 const web::json::value &body,
114 const web::http::method &method,
123 virtual void HandleDeleteObserver(IRESTObserver *observer,
const web::uri &uri = {}) = 0;
125 virtual const std::map<int, RESTServer *>& GetServerMap() = 0;
126 virtual const std::map<std::pair<int, utility::string_t>, IRESTObserver *>& GetObservers() = 0;