RadioLib
Universal wireless communication library for Arduino
HTTP.h
1 #if !defined(_RADIOLIB_HTTP_H)
2 #define _RADIOLIB_HTTP_H
3 
4 #include "../../TypeDef.h"
5 
6 #if !defined(RADIOLIB_EXCLUDE_HTTP)
7 
8 #include "../TransportLayer/TransportLayer.h"
9 
15 class HTTPClient {
16  public:
24  explicit HTTPClient(TransportLayer* tl, uint16_t port = 80);
25 
35  int16_t get(String& url, String& response);
36 
46  int16_t get(const char* url, String& response);
47 
61  int16_t post(const char* url, const char* content, String& response, const char* contentType = "text/plain");
62 
63 #ifndef RADIOLIB_GODMODE
64  private:
65 #endif
66  TransportLayer* _tl;
67 
68  uint16_t _port;
69 };
70 
71 #endif
72 
73 #endif
Provides common interface for protocols that run on modules with Internet connectivity, such as HTTP or MQTT. Because this class is used mainly as interface, all of its virtual members must be implemented in the module class.
Definition: TransportLayer.h:12
int16_t post(const char *url, const char *content, String &response, const char *contentType="text/plain")
Sends HTTP POST request.
Definition: HTTP.cpp:112
HTTPClient(TransportLayer *tl, uint16_t port=80)
Default constructor.
Definition: HTTP.cpp:4
Client for simple HTTP communication.
Definition: HTTP.h:15