23 #ifndef INCLUDE_HUEPLUSPLUS_BASE_HTTP_HANDLER_H 24 #define INCLUDE_HUEPLUSPLUS_BASE_HTTP_HANDLER_H 33 #include "json/json.hpp" 52 std::string
sendGetHTTPBody(
const std::string& msg,
const std::string& adr,
int port = 80)
const override;
65 std::string
sendHTTPRequest(
const std::string& method,
const std::string& uri,
const std::string& contentType,
66 const std::string& body,
const std::string& adr,
int port = 80)
const override;
79 std::string
GETString(
const std::string& uri,
const std::string& contentType,
const std::string& body,
80 const std::string& adr,
int port = 80)
const override;
93 std::string
POSTString(
const std::string& uri,
const std::string& contentType,
const std::string& body,
94 const std::string& adr,
int port = 80)
const override;
107 std::string
PUTString(
const std::string& uri,
const std::string& contentType,
const std::string& body,
108 const std::string& adr,
int port = 80)
const override;
121 std::string
DELETEString(
const std::string& uri,
const std::string& contentType,
const std::string& body,
122 const std::string& adr,
int port = 80)
const override;
135 const std::string& uri,
const nlohmann::json& body,
const std::string& adr,
int port = 80)
const override;
148 const std::string& uri,
const nlohmann::json& body,
const std::string& adr,
int port = 80)
const override;
161 const std::string& uri,
const nlohmann::json& body,
const std::string& adr,
int port = 80)
const override;
174 const std::string& uri,
const nlohmann::json& body,
const std::string& adr,
int port = 80)
const override;
std::string DELETEString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override
Send a HTTP DELETE request to the specified host and return the body of the response.
Definition: BaseHttpHandler.cpp:97
virtual ~BaseHttpHandler()=default
Virtual dtor.
std::string POSTString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override
Send a HTTP POST request to the specified host and return the body of the response.
Definition: BaseHttpHandler.cpp:85
Namespace for the hueplusplus library.
Definition: Action.h:27
nlohmann::json POSTJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override
Send a HTTP POST request to the specified host and return the body of the response parsed as JSON...
Definition: BaseHttpHandler.cpp:109
Abstract class for classes that handle http requests and multicast requests.
Definition: IHttpHandler.h:37
nlohmann::json GETJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override
Send a HTTP GET request to the specified host and return the body of the response parsed as JSON...
Definition: BaseHttpHandler.cpp:103
std::string GETString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override
Send a HTTP GET request to the specified host and return the body of the response.
Definition: BaseHttpHandler.cpp:79
nlohmann::json PUTJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override
Send a HTTP PUT request to the specified host and return the body of the response parsed as JSON...
Definition: BaseHttpHandler.cpp:115
std::string sendHTTPRequest(const std::string &method, const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override
Send a HTTP request with the given method to the specified host and return the body of the response...
Definition: BaseHttpHandler.cpp:46
std::string sendGetHTTPBody(const std::string &msg, const std::string &adr, int port=80) const override
Send a message to a specified host and return the body of the response.
Definition: BaseHttpHandler.cpp:29
nlohmann::json DELETEJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override
Send a HTTP DELETE request to the specified host and return the body of the response parsed as JSON...
Definition: BaseHttpHandler.cpp:121
std::string PUTString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override
Send a HTTP PUT request to the specified host and return the body of the response.
Definition: BaseHttpHandler.cpp:91
Base class for classes that handle http requests and multicast requests.
Definition: BaseHttpHandler.h:38