LTE-M Leaf Library
hl7800_http.h
Go to the documentation of this file.
1 
9 #ifndef HL7800_HTTP_H
10 #define HL7800_HTTP_H
11 
12 #include "Arduino.h"
13 #include "common.h"
14 #include "IPAddress.h"
15 
16 #define HTTP_PORT 80
17 #define HTTPS_PORT 81
18 #define USE_HTTP 0 // HTTP 1.1
19 #define USE_HTTPS 2 // HTTP 1.1 over TLS
20 #define USE_IPV4 0
21 #define USE_IPV6 1
22 
23 class HL7800Http {
24 public:
25  HL7800Http(); // Constructor
26  int connect(IPAddress ip, uint16_t port, int http_version, char* login, char* passwd);
27  int connect(char* url, uint16_t port, int http_version, char* login, char* passwd);
28  int config(char* header);
29 
30  int get(char* uri, char* buff, bool show_resp);
31  int head(char* uri, char* buff);
32  int post(char* uri, char* buff, bool show_resp);
33  int put(char* uri, char* sndbuff, char* rcvbuff, bool show_resp);
34 
35  bool connected();
36  void close();
37 
38 private:
39  char cmd[70];
40  bool http_connect;
41 };
42 
43 
44 #endif // HL7800_HTTP_H
HL7800Http::put
int put(char *uri, char *sndbuff, char *rcvbuff, bool show_resp)
Definition: hl7800_http.cpp:348
HL7800Http::connected
bool connected()
Definition: hl7800_http.cpp:392
HL7800Http::get
int get(char *uri, char *buff, bool show_resp)
Definition: hl7800_http.cpp:215
HL7800Http::config
int config(char *header)
Definition: hl7800_http.cpp:173
HL7800Http
Definition: hl7800_http.h:23
HL7800Http::HL7800Http
HL7800Http()
Definition: hl7800_http.cpp:99
HL7800Http::connect
int connect(IPAddress ip, uint16_t port, int http_version, char *login, char *passwd)
Definition: hl7800_http.cpp:112
HL7800Http::close
void close()
Definition: hl7800_http.cpp:401
HL7800Http::post
int post(char *uri, char *buff, bool show_resp)
Definition: hl7800_http.cpp:294
HL7800Http::head
int head(char *uri, char *buff)
Definition: hl7800_http.cpp:256