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
HTTPClient::HTTPClient
HTTPClient(TransportLayer *tl, uint16_t port=80)
Default constructor.
Definition: HTTP.cpp:4
HTTPClient::get
int16_t get(String &url, String &response)
Sends HTTP GET request.
Definition: HTTP.cpp:9
HTTPClient
Client for simple HTTP communication.
Definition: HTTP.h:15
HTTPClient::post
int16_t post(const char *url, const char *content, String &response, const char *contentType="text/plain")
Sends HTTP POST request.
Definition: HTTP.cpp:112
TransportLayer
Provides common interface for protocols that run on modules with Internet connectivity,...
Definition: TransportLayer.h:12