|
hueplusplus 1.2.0
|
Class to handle http requests and multicast requests on windows systems. More...
#include <hueplusplus/WinHttpHandler.h>
Inheritance diagram for hueplusplus::WinHttpHandler:
Collaboration diagram for hueplusplus::WinHttpHandler:Public Member Functions | |
| WinHttpHandler () | |
| Ctor needed for initializing wsaData. | |
| ~WinHttpHandler () | |
| Dtor needed for wsaData cleanup. | |
| std::string | send (const std::string &msg, const std::string &adr, int port=80) const override |
| Function that sends a given message to the specified host and returns the response. | |
| std::vector< std::string > | sendMulticast (const std::string &msg, const std::string &adr="239.255.255.250", int port=1900, std::chrono::steady_clock::duration timeout=std::chrono::seconds(5)) const override |
| Function that sends a multicast request with the specified message. | |
Public Member Functions inherited from hueplusplus::BaseHttpHandler | |
| virtual | ~BaseHttpHandler ()=default |
| Virtual dtor. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
Public Member Functions inherited from hueplusplus::IHttpHandler | |
| virtual | ~IHttpHandler ()=default |
| Virtual dtor. | |
Class to handle http requests and multicast requests on windows systems.
| hueplusplus::WinHttpHandler::WinHttpHandler | ( | ) |
Ctor needed for initializing wsaData.
| hueplusplus::WinHttpHandler::~WinHttpHandler | ( | ) |
Dtor needed for wsaData cleanup.
|
overridevirtual |
Function that sends a given message to the specified host and returns the response.
| msg | String that contains the message that is sent to the specified address |
| adr | String that contains an ip or hostname in dotted decimal notation like "192.168.2.1" |
| port | Optional integer that specifies the port to which the request is sent to. Default is 80 |
Implements hueplusplus::IHttpHandler.
|
overridevirtual |
Function that sends a multicast request with the specified message.
| msg | String that contains the request that is sent to the specified address |
| adr | Optional String that contains an ip or hostname in dotted decimal notation, default is "239.255.255.250" |
| port | Optional integer that specifies the port to which the request is sent. Default is 1900 |
| timeout | Optional The timeout of the request. Default is 5 seconds |
Implements hueplusplus::IHttpHandler.