1#ifndef Arduino_HTTP_Client_h
2#define Arduino_HTTP_Client_h
10#include <ArduinoHttpClient.h>
25 Arduino_HTTP_Client(Client& transport_client,
char const * host, uint16_t port);
27 ~Arduino_HTTP_Client()
override =
default;
31 int connect(
char const * host, uint16_t port)
override;
35 int post(
char const * url_path,
char const * content_type,
char const * request_body)
override;
39 int get(
char const * url_path)
override;
41#if THINGSBOARD_ENABLE_STL
48 HttpClient m_http_client;
HTTP Client interface that contains the method that a class that can be used to send and receive data...
Definition: IHTTP_Client.h:22
virtual int post(char const *url_path, char const *content_type, char const *request_body)=0
Connects to the server and sends a POST request with a body and content type.
virtual void stop()=0
Disconnects the given device from the current host and clears about any remaining bytes still in the ...
virtual int get(const char *url_path)=0
Connects to the server and sends a GET request.
virtual std::string get_response_body()=0
Returns the response body of a previously sent message as a string object, skips any response headers...
virtual void set_keep_alive(bool keep_alive)=0
Sets whether to close the HTTP connection for every single request and reconnect once a new request i...
virtual int connect(char const *host, uint16_t port)=0
Connects to the given server instance over the defined port.
virtual int get_response_status_code()=0
Gets the HTTP status code contained in the server response.