RadioLib
Universal wireless communication library for Arduino
HTTPClient Class Reference

Client for simple HTTP communication. More...

#include <HTTP.h>

Public Member Functions

 HTTPClient (TransportLayer *tl, uint16_t port=80)
 Default constructor. More...
 
int16_t get (String &url, String &response)
 Sends HTTP GET request. More...
 
int16_t get (const char *url, String &response)
 Sends HTTP GET request. More...
 
int16_t post (const char *url, const char *content, String &response, const char *contentType="text/plain")
 Sends HTTP POST request. More...
 

Detailed Description

Client for simple HTTP communication.

Constructor & Destructor Documentation

◆ HTTPClient()

HTTPClient::HTTPClient ( TransportLayer tl,
uint16_t  port = 80 
)
explicit

Default constructor.

Parameters
tlPointer to the wireless module providing TransportLayer communication.
portPort to be used for HTTP. Defaults to 80.

Member Function Documentation

◆ get() [1/2]

int16_t HTTPClient::get ( String &  url,
String &  response 
)

Sends HTTP GET request.

Parameters
urlURL to send the request to.
responseArduino String object that will save the response.
Returns
Status Codes

◆ get() [2/2]

int16_t HTTPClient::get ( const char *  url,
String &  response 
)

Sends HTTP GET request.

Parameters
urlURL to send the request to.
responseArduino String object that will save the response.
Returns
Status Codes

◆ post()

int16_t HTTPClient::post ( const char *  url,
const char *  content,
String &  response,
const char *  contentType = "text/plain" 
)

Sends HTTP POST request.

Parameters
urlURL to send the request to.
contentRequest content.
responseArduino String object that will save the response.
contentTypeMIME type of request content. Defaults to "text/plain".
Returns
Status Codes

The documentation for this class was generated from the following files: