NetBurner 3.5.6
PDF Version
Web Client

Topics

 Web Client Error Codes
 

Classes

class  ParsedURI
 Parsed Uniform Resource Identifier Class (URI) More...
 
class  buffer_object
 Base class for web client response buffers. More...
 
class  SimpleBufferObject
 Class for web client response buffers. More...
 
class  StringBufferObject
 Class for NBString-based web client response buffers. More...
 

Functions

void SetHttpDiag (bool b)
 Enable/disable Web Client HTTP diagnostics to the console port.
 
void SetHttpDiag (int level)
 Enable/disable Web Client HTTP diagnostics to the console port.
 
int DoMultipartStartHttp (HttpMethod method, ParsedURI &TheUri, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Start a multipart HTTP post using a pre-parsed URI object.
 
int DoMultipartStartHttp (HttpMethod method, const char *pUrl, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Start a multipart HTTP post using a pointer to a URL.
 
int DoMultipartStartPost (ParsedURI &TheUri, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Start a multipart HTTP post using a pre-parsed URI object.
 
int DoMultipartStartPost (const char *pUrl, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Start a multipart HTTP post using a pointer to a URL.
 
void DoMultipartItem (int tcpfd, const char *Disposition, const char *separator, const unsigned char *data, int len)
 Send a multipart item.
 
void DoMultipartBoundary (int tcpfd, const char *Disposition, const char *separator)
 Send a multipart boundary.
 
bool DoMultipartFinished (int tcpfd, const char *separator, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Finish sending the multipart request and parse the response into a buffer.
 
bool DoMultipartFinished (int tcpfd, const char *separator, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoUrlEncodedFormHttp (HttpMethod method, ParsedURI &TheUri, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 Send a JSON file using a HTTP Form and a a ParsedURI object.
 
bool DoUrlEncodedFormPost (ParsedURI &TheUri, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 Post a JSON file using a HTTP Form Post and a a ParsedURI object.
 
bool DoUrlEncodedFormHttp (HttpMethod method, ParsedURI &TheUri, char *headers, char *form_data, NBString &result_string, uint16_t TIMEOUT_WAIT)
 
bool DoUrlEncodedFormPost (ParsedURI &TheUri, char *headers, char *form_data, NBString &result_string, uint16_t TIMEOUT_WAIT)
 
bool DoUrlEncodedFormHttp (HttpMethod method, const char *pUrl, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 
bool DoUrlEncodedFormPost (const char *pUrl, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 
bool DoUrlEncodedFormPost (const char *pUrl, char *headers, char *form_data, NBString &result_string, uint16_t TIMEOUT_WAIT)
 
bool DoJsonHttp (HttpMethod method, const char *pUrl, const char *Json_Data_To_Post, buffer_object &result_buffer, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.
 
bool DoJsonPost (const char *pUrl, const char *Json_Data_To_Post, buffer_object &result_buffer, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.
 
bool DoJsonHttp (HttpMethod method, const char *pUrl, const char *Json_Data_To_Post, NBString &result_string, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (const char *pUrl, const char *Json_Data_To_Post, NBString &result_string, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttp (HttpMethod method, ParsedURI &TheUri, const char *Json_Data_To_Post, buffer_object &result_buffer, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (ParsedURI &TheUri, const char *Json_Data_To_Post, buffer_object &result_buffer, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttp (HttpMethod method, ParsedURI &TheUri, const char *Json_Data_To_Post, NBString &result_string, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (ParsedURI &TheUri, const char *Json_Data_To_Post, NBString &result_string, const char *AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttp (HttpMethod method, const char *pUrl, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (const char *pUrl, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttp (HttpMethod method, const char *pUrl, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (const char *pUrl, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttp (HttpMethod method, ParsedURI &TheUri, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (ParsedURI &TheUri, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttp (HttpMethod method, ParsedURI &TheUri, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPost (ParsedURI &TheUri, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttpFile (HttpMethod method, const char *pUrl, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Send a JSON file using HTTP and a URL string.
 
bool DoJsonPostHttpFile (const char *pUrl, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Post a JSON file using HTTP and a URL string.
 
bool DoJsonHttpFile (HttpMethod method, const char *pUrl, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPostHttpFile (const char *pUrl, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonHttpFile (HttpMethod method, ParsedURI &TheUri, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Send a JSON file using HTTP and a ParsedURI object.
 
bool DoJsonPostHttpFile (ParsedURI &TheUri, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Post a JSON file using HTTP and a ParsedURI object.
 
bool DoJsonHttpFile (HttpMethod method, ParsedURI &TheUri, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoJsonPostHttpFile (ParsedURI &TheUri, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoHttp (HttpMethod method, ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoGet (ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoHttp (HttpMethod method, ParsedURI &TheUri, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoGet (ParsedURI &TheUri, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoHttpEx (HttpMethod method, ParsedURI &TheUri, const char *headers, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoGetEx (ParsedURI &TheUri, const char *headers, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoHttpEx (HttpMethod method, ParsedURI &TheUri, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoGetEx (ParsedURI &TheUri, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoHttp (HttpMethod method, const char *pUrl, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS request using a pointer to a URL string.
 
bool DoGet (const char *pUrl, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS GET request using a pointer to a URL string.
 
bool DoHttp (HttpMethod method, const char *pUrl, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoGet (const char *pUrl, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoHttpEx (HttpMethod method, const char *pUrl, const char *headers, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS request using a pointer to a URL string.
 
bool DoGetEx (const char *pUrl, const char *headers, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS GET request using a pointer to a URL string.
 
bool DoHttpEx (HttpMethod method, const char *pUrl, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
bool DoGetEx (const char *pUrl, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 
int DoHttp (HttpMethod method, ParsedURI &TheUri, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS request using a reference to a parsed Uniform Resource Identifier (URI)
 
int DoHttpEx (HttpMethod method, ParsedURI &TheUri, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS request using a reference to a parsed Uniform Resource Identifier (URI)
 
int DoHttp (HttpMethod method, const char *pUrl, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS request using a pointer to a URL string.
 
int DoHttpEx (HttpMethod method, const char *pUrl, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS request using a pointer to a URL string.
 
int DoGet (ParsedURI &TheUri, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)
 
int DoGetEx (ParsedURI &TheUri, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)
 
int DoGet (const char *pUrl, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS GET request using a pointer to a URL string.
 
int DoGetEx (const char *pUrl, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a HTTP/HTTPS GET request using a pointer to a URL string.
 
int DoGetUpdate (ParsedURI &TheUri, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a firmware update from the specified URI.
 
int DoGetUpdate (const char *pUrl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Execute a firmware update from the specified URI.
 
int PopulateAuthHeader (const char *user, const char *password, char *buffer, int maxlen)
 Fill in a username and password into a buffer for use as an extra header.
 
bool DoActualClientRequest (ParsedURI &TheUri, uint16_t &next_time_delay)
 Callback to specify for performing and handle a WebClient request.
 
bool StartWebClient (int prio, const char *url1, const char *url2=NULL, bool bDoNtp=false)
 Start the web client using a URL string.
 
bool StartWebClient (int prio, const NBString &url1, const NBString &url2, bool bDoNtp=false)
 Start the web client using a NBString.
 
bool StartWebClient (int prio, const NBString &url1, bool bDoNtp=false)
 Start the web client using a NBString.
 

Variables

WebErrorReporterFunc * pWebErrorReporter
 Set this variable to a callback function to specify a handler for errors.
 

Detailed Description

#include< http_funcs.h>


Functions for interacting with the web, like HTTP GET/POST requests.

An easy way to get web data (from our GetNonJsonFromServer example):
const char *purl = "http://www.example.com/";
int result = 0;
static unsigned char ResultBuffer[5000];
result = DoGet(purl, ResultBuffer, 5000, 60 * TICKS_PER_SECOND);
if (result > 0)
{
printf("Result = %d\r\n[", result);
for (int i = 0; i < result; i++)
{
printf("%c", ResultBuffer[i]);
}
printf("]\r\n");
}
else
{
iprintf("Failed to contact server\r\n");
}
#define TICKS_PER_SECOND
System clock ticks per second.
Definition constants.h:49
bool DoGet(ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
Definition http_funcs.h:939

#include< web_client.h>


Functions for instantiating a periodic web client

From our WebClient examples:
const char *url = "http://www.example.com";
void HandleErrorState(int state)
{
if (state == WEB_CLIENT_ERROR_NO_ERROR) return;
if ((state <= WEB_CLIENT_ERROR_LAST_STATE) && (state > 0))
iprintf("Set Error state [%d] [%s]\r\n", state, web_error_state_text[state]);
else
iprintf("Error state unknown %d\r\n", state);
}
bool DoActualClientRequest(ParsedURI &TheUri, uint16_t &next_time_delay)
{
static unsigned char ResultBuffer[5000];
bool result = DoGet(TheUri, ResultBuffer);
if (result)
{
printf("Result = %d\r\n[", result);
for (int i = 0; i < result; i++)
{
printf("%c", ResultBuffer[i]);
}
printf("]\r\n");
next_time_delay = 10 * TICKS_PER_SECOND;
return true;
}
next_time_delay = 10 * TICKS_PER_SECOND;
return false;
}
void UserMain(void *pd)
{
init();
pWebErrorReporter = HandleErrorState;
while (1)
{
}
}
Parsed Uniform Resource Identifier Class (URI)
Definition http_funcs.h:62
#define MAIN_PRIO
Recommend UserMain priority.
Definition constants.h:130
void OSTimeDly(uint32_t to_count)
Delay the task until the specified value of the system timer ticks. The number of system ticks per se...
Definition nbrtos.h:1850
bool StartWebClient(int prio, const char *url1, const char *url2=NULL, bool bDoNtp=false)
Start the web client using a URL string.
bool DoActualClientRequest(ParsedURI &TheUri, uint16_t &next_time_delay)
Callback to specify for performing and handle a WebClient request.
Definition WebClient/FindMyIpTask/src/main.cpp:26
void init()
System initialization. Ideally called at the beginning of all applications, since the easiest Recover...
bool WaitForActiveNetwork(uint32_t ticks_to_wait=120 *TICKS_PER_SECOND, int interface=-1)
Wait for an active network connection on at least one interface.
#define WEB_CLIENT_ERROR_NO_ERROR
No error.
Definition web_client.h:86
void UserMain(void *pd)
Main function.
Definition PlatformSpecific/SAME70/MODM7AE70/ADC_Simple/src/main.cpp:42

Function Documentation

◆ DoActualClientRequest()

bool DoActualClientRequest ( ParsedURI & TheUri,
uint16_t & next_time_delay )

#include <web_client.h>

Callback to specify for performing and handle a WebClient request.

Parameters
TheUriPointer to a ParsedURI object (representing the URL)
next_time_delayPointer to the number of ticks to wait before the next request
Returns
True on success, false on failure.

◆ DoGet() [1/6]

bool DoGet ( const char * pUrl,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Execute a HTTP/HTTPS GET request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
&result_bufferReference to the memory buffer in which to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoGet() [2/6]

bool DoGet ( const char * pUrl,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoGet() [3/6]

int DoGet ( const char * pUrl,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Execute a HTTP/HTTPS GET request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoGet() [4/6]

bool DoGet ( ParsedURI & TheUri,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Parameters
&TheUriReference to the pre-parsed URI.
&result_bufferReference to the location to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoGet() [5/6]

bool DoGet ( ParsedURI & TheUri,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoGet() [6/6]

int DoGet ( ParsedURI & TheUri,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)

This function uses a reference to a parsed URI, providing faster execution and avoiding parsing a URL, DNS, etc.

Parameters
TheUriReference to the ParsedURI object.
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoGetEx() [1/6]

bool DoGetEx ( const char * pUrl,
const char * headers,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Execute a HTTP/HTTPS GET request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
&result_bufferReference to the memory buffer in which to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoGetEx() [2/6]

bool DoGetEx ( const char * pUrl,
const char * headers,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoGetEx() [3/6]

int DoGetEx ( const char * pUrl,
const char * headers,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Execute a HTTP/HTTPS GET request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoGetEx() [4/6]

bool DoGetEx ( ParsedURI & TheUri,
const char * headers,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Parameters
&TheUriReference to the pre-parsed URI.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
&result_bufferReference to the location to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoGetEx() [5/6]

bool DoGetEx ( ParsedURI & TheUri,
const char * headers,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoGetEx() [6/6]

int DoGetEx ( ParsedURI & TheUri,
const char * headers,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)

This function uses a reference to a parsed URI, providing faster execution and avoiding parsing a URL, DNS, etc.

Parameters
TheUriReference to the ParsedURI object.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoGetUpdate() [1/2]

int DoGetUpdate ( const char * pUrl,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a firmware update from the specified URI.

Parameters
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoGetUpdate() [2/2]

int DoGetUpdate ( ParsedURI & TheUri,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a firmware update from the specified URI.

Parameters
TheUriReference to the ParsedURI object.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoHttp() [1/6]

bool DoHttp ( HttpMethod method,
const char * pUrl,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a HTTP/HTTPS request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
&result_bufferReference to the memory buffer in which to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoHttp() [2/6]

bool DoHttp ( HttpMethod method,
const char * pUrl,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoHttp() [3/6]

int DoHttp ( HttpMethod method,
const char * pUrl,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a HTTP/HTTPS request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoHttp() [4/6]

bool DoHttp ( HttpMethod method,
ParsedURI & TheUri,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Parameters
methodHTTP Method to use
&TheUriReference to the pre-parsed URI.
&result_bufferReference to the location to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoHttp() [5/6]

bool DoHttp ( HttpMethod method,
ParsedURI & TheUri,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoHttp() [6/6]

int DoHttp ( HttpMethod method,
ParsedURI & TheUri,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a HTTP/HTTPS request using a reference to a parsed Uniform Resource Identifier (URI)

This function uses a reference to a parsed URI, providing faster execution and avoiding parsing a URL, DNS, etc.

Parameters
methodHTTP Method to use
TheUriReference to the ParsedURI object.
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoHttpEx() [1/6]

bool DoHttpEx ( HttpMethod method,
const char * pUrl,
const char * headers,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a HTTP/HTTPS request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
&result_bufferReference to the memory buffer in which to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoHttpEx() [2/6]

bool DoHttpEx ( HttpMethod method,
const char * pUrl,
const char * headers,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoHttpEx() [3/6]

int DoHttpEx ( HttpMethod method,
const char * pUrl,
const char * headers,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a HTTP/HTTPS request using a pointer to a URL string.

This function will parse the URL string to connect to the host.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string. A DNS lookup will be done if necessary.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoHttpEx() [4/6]

bool DoHttpEx ( HttpMethod method,
ParsedURI & TheUri,
const char * headers,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Parameters
&TheUriReference to the pre-parsed URI.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
&result_bufferReference to the location to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoHttpEx() [5/6]

bool DoHttpEx ( HttpMethod method,
ParsedURI & TheUri,
const char * headers,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoHttpEx() [6/6]

int DoHttpEx ( HttpMethod method,
ParsedURI & TheUri,
const char * headers,
unsigned char * result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Execute a HTTP/HTTPS request using a reference to a parsed Uniform Resource Identifier (URI)

This function uses a reference to a parsed URI, providing faster execution and avoiding parsing a URL, DNS, etc.

Parameters
methodHTTP Method to use
TheUriReference to the ParsedURI object.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
resultPointer to the buffer in which to store the result.
maxlMaximum length of the result buffer.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns

◆ DoJsonHttp() [1/8]

bool DoJsonHttp ( HttpMethod method,
const char * pUrl,
const char * Json_Data_To_Post,
buffer_object & result_buffer,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string.
Json_Data_To_PostPointer to serialized JSON data to send
&result_bufferReference to the location in which to store the result.
AdditionalHeadersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoJsonHttp() [2/8]

bool DoJsonHttp ( HttpMethod method,
const char * pUrl,
const char * Json_Data_To_Post,
NBString & result_string,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonHttp() [3/8]

bool DoJsonHttp ( HttpMethod method,
const char * pUrl,
ParsedJsonDataSet & jsonout,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
pUrlPointer to a URL string.
jsonoutReference to ParsedJsonDataSet to send.
Returns
True on success, false on failure.
See also
JSON Lexer

◆ DoJsonHttp() [4/8]

bool DoJsonHttp ( HttpMethod method,
const char * pUrl,
ParsedJsonDataSet & jsonout,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonHttp() [5/8]

bool DoJsonHttp ( HttpMethod method,
ParsedURI & TheUri,
const char * Json_Data_To_Post,
buffer_object & result_buffer,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&TheUriReference to the pre-parsed URI.

◆ DoJsonHttp() [6/8]

bool DoJsonHttp ( HttpMethod method,
ParsedURI & TheUri,
const char * Json_Data_To_Post,
NBString & result_string,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonHttp() [7/8]

bool DoJsonHttp ( HttpMethod method,
ParsedURI & TheUri,
ParsedJsonDataSet & jsonout,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ DoJsonHttp() [8/8]

bool DoJsonHttp ( HttpMethod method,
ParsedURI & TheUri,
ParsedJsonDataSet & jsonout,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ DoJsonHttpFile() [1/4]

bool DoJsonHttpFile ( HttpMethod method,
const char * pUrl,
const char * FragmentName,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Send a JSON file using HTTP and a URL string.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string.
FragmentName
&result_bufferReference to the location in which to store the result.
AdditionalHeadersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoJsonHttpFile() [2/4]

bool DoJsonHttpFile ( HttpMethod method,
const char * pUrl,
const char * FragmentName,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonHttpFile() [3/4]

bool DoJsonHttpFile ( HttpMethod method,
ParsedURI & TheUri,
const char * FragmentName,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Send a JSON file using HTTP and a ParsedURI object.

Parameters
methodHTTP Method to use (Post, Put, or Patch)
&TheUriReference to the pre-parsed URI.
FragmentName
&result_bufferReference to the location in which to store the result.
AdditionalHeaders
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoJsonHttpFile() [4/4]

bool DoJsonHttpFile ( HttpMethod method,
ParsedURI & TheUri,
const char * FragmentName,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonPost() [1/8]

bool DoJsonPost ( const char * pUrl,
const char * Json_Data_To_Post,
buffer_object & result_buffer,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.

Parameters
pUrlPointer to a URL string.
Json_Data_To_PostPointer to serialized JSON data to send
&result_bufferReference to the location in which to store the result.
AdditionalHeadersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoJsonPost() [2/8]

bool DoJsonPost ( const char * pUrl,
const char * Json_Data_To_Post,
NBString & result_string,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonPost() [3/8]

bool DoJsonPost ( const char * pUrl,
ParsedJsonDataSet & jsonout,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
pUrlPointer to a URL string.
jsonoutReference to ParsedJsonDataSet to send.
Returns
True on success, false on failure.
See also
JSON Lexer

◆ DoJsonPost() [4/8]

bool DoJsonPost ( const char * pUrl,
ParsedJsonDataSet & jsonout,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonPost() [5/8]

bool DoJsonPost ( ParsedURI & TheUri,
const char * Json_Data_To_Post,
buffer_object & result_buffer,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&TheUriReference to the pre-parsed URI.

◆ DoJsonPost() [6/8]

bool DoJsonPost ( ParsedURI & TheUri,
const char * Json_Data_To_Post,
NBString & result_string,
const char * AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonPost() [7/8]

bool DoJsonPost ( ParsedURI & TheUri,
ParsedJsonDataSet & jsonout,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ DoJsonPost() [8/8]

bool DoJsonPost ( ParsedURI & TheUri,
ParsedJsonDataSet & jsonout,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ DoJsonPostHttpFile() [1/4]

bool DoJsonPostHttpFile ( const char * pUrl,
const char * FragmentName,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Post a JSON file using HTTP and a URL string.

Parameters
pUrlPointer to a URL string.
FragmentName
&result_bufferReference to the location in which to store the result.
AdditionalHeadersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoJsonPostHttpFile() [2/4]

bool DoJsonPostHttpFile ( const char * pUrl,
const char * FragmentName,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoJsonPostHttpFile() [3/4]

bool DoJsonPostHttpFile ( ParsedURI & TheUri,
const char * FragmentName,
buffer_object & result_buffer,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

Post a JSON file using HTTP and a ParsedURI object.

Parameters
&TheUriReference to the pre-parsed URI.
FragmentName
&result_bufferReference to the location in which to store the result.
AdditionalHeaders
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoJsonPostHttpFile() [4/4]

bool DoJsonPostHttpFile ( ParsedURI & TheUri,
const char * FragmentName,
NBString & result_string,
const char * AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoMultipartBoundary()

void DoMultipartBoundary ( int tcpfd,
const char * Disposition,
const char * separator )

#include <http_funcs.h>

Send a multipart boundary.

Parameters
tcpfdTCP file descriptor returned from DoMultipartStartPost()
DispositionContent disposition field of multipart body
separatorSeparator string to use as the part delimiter between multipart posts.

◆ DoMultipartFinished() [1/2]

bool DoMultipartFinished ( int tcpfd,
const char * separator,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Finish sending the multipart request and parse the response into a buffer.

Parameters
tcpfdTCP file descriptor returned from DoMultipartStartPost()
separatorSeparator string to use as the part delimiter between multipart posts.
result_bufferReference to buffer to store response from the server.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
true for a 200 OK response with a body, false for failure

◆ DoMultipartFinished() [2/2]

bool DoMultipartFinished ( int tcpfd,
const char * separator,
NBString & result_string,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString to store response from the server.

◆ DoMultipartItem()

void DoMultipartItem ( int tcpfd,
const char * Disposition,
const char * separator,
const unsigned char * data,
int len )

#include <http_funcs.h>

Send a multipart item.

Parameters
tcpfdTCP file descriptor returned from DoMultipartStartPost()
DispositionContent disposition field of multipart body
separatorSeparator string to use as the part delimiter between multipart posts.
dataItem data
lenData length

◆ DoMultipartStartHttp() [1/2]

int DoMultipartStartHttp ( HttpMethod method,
const char * pUrl,
const char * separator,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND,
uint32_t contentLength = 0 )

#include <http_funcs.h>

Start a multipart HTTP post using a pointer to a URL.

Parameters
methodHTTP Method to use
pUrlPointer to a URL string.
separatorSeparator string to use as the part delimiter between multipart posts.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
contentLengthIf given, content length for the entire multipart post.
Returns
A TCP/TLS file descriptor greater than 0 if a socket was successfully opened, or TCP Socket Status on failure.

◆ DoMultipartStartHttp() [2/2]

int DoMultipartStartHttp ( HttpMethod method,
ParsedURI & TheUri,
const char * separator,
uint16_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND,
uint32_t contentLength = 0 )

#include <http_funcs.h>

Start a multipart HTTP post using a pre-parsed URI object.

Parameters
methodHTTP Method to use
&TheUriReference to the pre-parsed URI object.
separatorSeparator string to use as the part delimiter between multipart posts.
TIMEOUT_WAITTimeout in seconds to wait for a response.
contentLengthIf given, content length for the entire multipart post.
Returns
A TCP/TLS file descriptor greater than 0 if a socket was successfully opened, or TCP Socket Status on failure.

◆ DoMultipartStartPost() [1/2]

int DoMultipartStartPost ( const char * pUrl,
const char * separator,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND,
uint32_t contentLength = 0 )
inline

#include <http_funcs.h>

Start a multipart HTTP post using a pointer to a URL.

Parameters
pUrlPointer to a URL string.
separatorSeparator string to use as the part delimiter between multipart posts.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
contentLengthIf given, content length for the entire multipart post.
Returns
A TCP/TLS file descriptor greater than 0 if a socket was successfully opened, or TCP Socket Status on failure.

◆ DoMultipartStartPost() [2/2]

int DoMultipartStartPost ( ParsedURI & TheUri,
const char * separator,
uint16_t TIMEOUT_WAIT = 10 * TICKS_PER_SECOND,
uint32_t contentLength = 0 )
inline

#include <http_funcs.h>

Start a multipart HTTP post using a pre-parsed URI object.

Parameters
&TheUriReference to the pre-parsed URI object.
separatorSeparator string to use as the part delimiter between multipart posts.
TIMEOUT_WAITTimeout in seconds to wait for a response.
contentLengthIf given, content length for the entire multipart post.
Returns
A TCP/TLS file descriptor greater than 0 if a socket was successfully opened, or TCP Socket Status on failure.

◆ DoUrlEncodedFormHttp() [1/3]

bool DoUrlEncodedFormHttp ( HttpMethod method,
const char * pUrl,
char * headers,
char * form_data,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT )

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
pUrlPointer to a URL string.

◆ DoUrlEncodedFormHttp() [2/3]

bool DoUrlEncodedFormHttp ( HttpMethod method,
ParsedURI & TheUri,
char * headers,
char * form_data,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT )

#include <http_funcs.h>

Send a JSON file using a HTTP Form and a a ParsedURI object.

Parameters
methodHTTP Method to use (Post, Put, or Patch)
&TheUriReference to the pre-parsed URI.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
form_dataPointer to the JSON data you are posting.
&result_bufferReference to the location in which to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoUrlEncodedFormHttp() [3/3]

bool DoUrlEncodedFormHttp ( HttpMethod method,
ParsedURI & TheUri,
char * headers,
char * form_data,
NBString & result_string,
uint16_t TIMEOUT_WAIT )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoUrlEncodedFormPost() [1/4]

bool DoUrlEncodedFormPost ( const char * pUrl,
char * headers,
char * form_data,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
pUrlPointer to a URL string.

◆ DoUrlEncodedFormPost() [2/4]

bool DoUrlEncodedFormPost ( const char * pUrl,
char * headers,
char * form_data,
NBString & result_string,
uint16_t TIMEOUT_WAIT )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ DoUrlEncodedFormPost() [3/4]

bool DoUrlEncodedFormPost ( ParsedURI & TheUri,
char * headers,
char * form_data,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT )
inline

#include <http_funcs.h>

Post a JSON file using a HTTP Form Post and a a ParsedURI object.

Parameters
&TheUriReference to the pre-parsed URI.
headersAdditional HTTP header fields. Multiple header fields should be concatenated together and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
form_dataPointer to the JSON data you are posting.
&result_bufferReference to the location in which to store the result.
TIMEOUT_WAITTimeout in in system time ticks to wait for a response.
Returns
True on success, false on failure.

◆ DoUrlEncodedFormPost() [4/4]

bool DoUrlEncodedFormPost ( ParsedURI & TheUri,
char * headers,
char * form_data,
NBString & result_string,
uint16_t TIMEOUT_WAIT )
inline

#include <http_funcs.h>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
&result_stringReference to NBString in which to store the result.

◆ PopulateAuthHeader()

int PopulateAuthHeader ( const char * user,
const char * password,
char * buffer,
int maxlen )

#include <http_funcs.h>

Fill in a username and password into a buffer for use as an extra header.

Parameters
userPointer to username
passwordPointer to password
bufferDestination buffer to put the authenticate header in.
maxlenMaximum number of chars to put in buffer
Returns
number of chars written, negative if the buffer was too small.

◆ SetHttpDiag() [1/2]

void SetHttpDiag ( bool b)

#include <http_funcs.h>

Enable/disable Web Client HTTP diagnostics to the console port.

Parameters
bSet true to enable, false to disable.

◆ SetHttpDiag() [2/2]

void SetHttpDiag ( int level)

#include <http_funcs.h>

Enable/disable Web Client HTTP diagnostics to the console port.

Parameters
levelSet 1 to enable, 0 to disable, or 2 for extra verbosity.

◆ StartWebClient() [1/3]

bool StartWebClient ( int prio,
const char * url1,
const char * url2 = NULL,
bool bDoNtp = false )

#include <web_client.h>

Start the web client using a URL string.

Parameters
prioPriority
url1Pointer to a string representing the URL.
url2Pointer to a second URL. Optional parameter, default is NULL.
bDoNtpEnable the Network Time Protocol (NTP). Optional parameter, default is false.
Returns
True on success, false on failure.

◆ StartWebClient() [2/3]

bool StartWebClient ( int prio,
const NBString & url1,
bool bDoNtp = false )

#include <web_client.h>

Start the web client using a NBString.

Parameters
prioPriority
url1Reference to a NBString representing the URL.
bDoNtpEnable the Network Time Protocol (NTP). Optional parameter, default is false.
Returns
True on success, false on failure.

◆ StartWebClient() [3/3]

bool StartWebClient ( int prio,
const NBString & url1,
const NBString & url2,
bool bDoNtp = false )

#include <web_client.h>

Start the web client using a NBString.

Parameters
prioPriority
url1Reference to a string representing the URL.
url2Reference to a second URL. Optional parameter, default is NULL.
bDoNtpEnable the Network Time Protocol (NTP). Optional parameter, default is false.
Returns
True on success, false on failure.