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)
 Initiates a multipart HTTP request using a pre-parsed URI and returns a connection file descriptor.
 
int DoMultipartStartHttp (HttpMethod method, const char *pUrl, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Initiates a multipart HTTP request using a URL string and returns a connection file descriptor.
 
int DoMultipartStartPost (ParsedURI &TheUri, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Initiates a multipart HTTP POST request using a pre-parsed URI and returns a connection file descriptor.
 
int DoMultipartStartPost (const char *pUrl, const char *separator, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND, uint32_t contentLength=0)
 Initiates a multipart HTTP POST request using a URL string and returns a connection file descriptor.
 
void DoMultipartItem (int tcpfd, const char *Disposition, const char *separator, const unsigned char *data, int len)
 Sends a multipart data item within an active multipart HTTP request.
 
void DoMultipartBoundary (int tcpfd, const char *Disposition, const char *separator)
 Sends a multipart boundary section within an active multipart HTTP request.
 
bool DoMultipartFinished (int tcpfd, const char *separator, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Completes a multipart HTTP request and retrieves the server response in a buffer object.
 
bool DoMultipartFinished (int tcpfd, const char *separator, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Completes a multipart HTTP request and retrieves the server response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that finalizes a multipart HTTP request and stores the server response in an NBString reference. The function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoMultipartFinished implementation. This provides string-based response handling for multipart operations where text-based responses are expected.
 
bool DoUrlEncodedFormHttp (HttpMethod method, ParsedURI &TheUri, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 Executes an HTTP request with URL-encoded form data using a pre-parsed URI and stores the response in a buffer object.
 
bool DoUrlEncodedFormPost (ParsedURI &TheUri, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 Executes an HTTP POST request with URL-encoded form data using a pre-parsed URI and stores the response in a buffer object.
 
bool DoUrlEncodedFormHttp (HttpMethod method, ParsedURI &TheUri, char *headers, char *form_data, NBString &result_string, uint16_t TIMEOUT_WAIT)
 Executes an HTTP request with URL-encoded form data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using URL-encoded form data and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoUrlEncodedFormHttp implementation. This provides flexibility for form-based HTTP operations with pre-parsed URIs and string-based response handling.
 
bool DoUrlEncodedFormPost (ParsedURI &TheUri, char *headers, char *form_data, NBString &result_string, uint16_t TIMEOUT_WAIT)
 Executes an HTTP POST request with URL-encoded form data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request with URL-encoded form data using a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoUrlEncodedFormHttp implementation. Using a pre-parsed URI can improve performance when making multiple form submissions to the same host by avoiding repeated URL parsing operations.
 
bool DoUrlEncodedFormHttp (HttpMethod method, const char *pUrl, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 Executes an HTTP request with URL-encoded form data using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core URL-encoded form HTTP function that performs an HTTP request with the specified method using URL-encoded form data and a URL string. The complete response body is stored in the provided buffer object. This function provides the foundation for form-based HTTP operations, supporting all standard HTTP methods while handling URL parsing and DNS resolution automatically. The form data is sent with the appropriate Content-Type header for proper server processing of web form submissions.
 
bool DoUrlEncodedFormPost (const char *pUrl, char *headers, char *form_data, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT)
 Executes an HTTP POST request with URL-encoded form data using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request with URL-encoded form data using a URL string. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoUrlEncodedFormHttp function, specifically optimized for POST operations with form data. This provides the most straightforward interface for web form submissions when you have URL-encoded form data and want to use automatic URL parsing with buffer-based response handling.
 
bool DoUrlEncodedFormPost (const char *pUrl, char *headers, char *form_data, NBString &result_string, uint16_t TIMEOUT_WAIT)
 Executes an HTTP POST request with URL-encoded form data using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request with URL-encoded form data using a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoUrlEncodedFormHttp implementation. This provides a simple interface for form-based POST operations with string-based response handling.
 
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)
 Executes an HTTP request with raw JSON data using a URL string and stores the response in a buffer object.
 
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)
 Executes an HTTP POST request with raw JSON data using a URL string and stores the response in a buffer object.
 
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)
 Executes an HTTP request with raw JSON data using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using raw JSON data provided as a string and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. The URL string will be parsed internally and DNS resolution will be performed automatically if needed, making this ideal for simple JSON operations with pre-formatted data.
 
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)
 Executes an HTTP POST request with raw JSON data using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using raw JSON data provided as a string and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides the simplest interface for JSON POST operations when you have pre-formatted JSON data and want string-based response handling with automatic URL parsing.
 
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)
 Executes an HTTP request with raw JSON data using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core JSON HTTP function for raw JSON string data that performs an HTTP request with the specified method using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided buffer object. This function provides the foundation for JSON HTTP operations with pre-formatted JSON strings, offering optimal performance through pre-parsed URI components while supporting all standard HTTP methods.
 
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)
 Executes an HTTP POST request with raw JSON data using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with pre-formatted JSON strings, providing a streamlined interface when you already have JSON data in string format.
 
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)
 Executes an HTTP request with raw JSON data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides flexibility for JSON operations with pre-formatted JSON strings and string-based response handling.
 
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)
 Executes an HTTP POST request with raw JSON data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides a simple interface for JSON POST operations with pre-formatted JSON strings and string-based response handling.
 
bool DoJsonHttp (HttpMethod method, const char *pUrl, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core JSON HTTP function that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided buffer object. This function provides the foundation for programmatic JSON HTTP operations with string-based URLs, allowing dynamic construction and manipulation of JSON data before transmission. The URL string will be parsed internally and DNS resolution will be performed automatically if needed.
 
bool DoJsonPost (const char *pUrl, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with programmatically constructed JSON data, providing a streamlined interface for common JSON API interactions.
 
bool DoJsonHttp (HttpMethod method, const char *pUrl, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides flexibility for programmatic JSON operations with string-based response handling and simplified URL specification.
 
bool DoJsonPost (const char *pUrl, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides a simple interface for JSON POST operations with programmatically constructed data and string-based response handling.
 
bool DoJsonHttp (HttpMethod method, ParsedURI &TheUri, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core JSON HTTP function that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided buffer object. This function provides the foundation for programmatic JSON HTTP operations, allowing dynamic construction and manipulation of JSON data before transmission. The ParsedJsonDataSet will be automatically serialized to JSON format for the request body.
 
bool DoJsonPost (ParsedURI &TheUri, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with programmatically constructed JSON data, providing a streamlined interface for common JSON API interactions.
 
bool DoJsonHttp (HttpMethod method, ParsedURI &TheUri, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides flexibility for programmatic JSON operations with string-based response handling.
 
bool DoJsonPost (ParsedURI &TheUri, ParsedJsonDataSet &jsonout, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This approach allows for dynamic JSON POST requests with programmatically constructed data.
 
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)
 Executes an HTTP request with JSON data from a file fragment using a URL string and stores the response in a buffer object.
 
bool DoJsonPostHttpFile (const char *pUrl, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a file fragment using a URL string and stores the response in a buffer object.
 
bool DoJsonHttpFile (HttpMethod method, const char *pUrl, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Performs an HTTP request and stores JSON response in an NBString This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that wraps the result NBString in a StringBufferObject and calls the main DoJsonHttpFile function.
 
bool DoJsonPostHttpFile (const char *pUrl, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Performs an HTTP POST request and stores JSON response in an NBString This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience wrapper function that simplifies HTTP POST operations with JSON response handling. It internally calls DoJsonHttpFile with HttpMethod::Post and automatically manages the buffer conversion from NBString to StringBufferObject. The function handles the complete HTTP transaction including connection establishment, request transmission, response reception, and JSON parsing. Only the specified JSON fragment is extracted from the response and stored in the result string, making it efficient for retrieving specific data from larger JSON responses. The function is particularly useful for REST API interactions where you need to POST data and extract a specific piece of information from the JSON response.
 
bool DoJsonHttpFile (HttpMethod method, ParsedURI &TheUri, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Sends an HTTP request and processes JSON response using a pre-parsed URI.
 
bool DoJsonPostHttpFile (ParsedURI &TheUri, const char *FragmentName, buffer_object &result_buffer, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a file fragment using a pre-parsed URI and stores the response in a buffer object.
 
bool DoJsonHttpFile (HttpMethod method, ParsedURI &TheUri, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with JSON data from a file fragment using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using JSON data loaded from a file fragment and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttpFile implementation. This approach provides maximum flexibility for JSON-based HTTP operations with pre-stored data fragments.
 
bool DoJsonPostHttpFile (ParsedURI &TheUri, const char *FragmentName, NBString &result_string, const char *AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP POST request with JSON data from a file fragment using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data loaded from a specified file fragment and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttpFile implementation. This approach allows for efficient JSON POST requests with pre-defined data stored in file fragments.
 
bool DoHttp (HttpMethod method, ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request using a pre-parsed URI and stores the response in a buffer object.
 
bool DoGet (ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request using a pre-parsed URI and stores the response in a buffer object.
 
bool DoHttp (HttpMethod method, ParsedURI &TheUri, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using a pre-parsed URI object and stores the complete response body in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttp implementation that accepts a buffer_object. Using a pre-parsed URI can improve performance when making multiple requests to the same host by avoiding repeated URL parsing operations.
 
bool DoGet (ParsedURI &TheUri, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP GET request using a pre-parsed URI object and stores the complete response body in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttp implementation. Using a pre-parsed URI can improve performance when making multiple requests to the same host by avoiding repeated URL parsing operations.
 
bool DoHttpEx (HttpMethod method, ParsedURI &TheUri, const char *headers, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with custom headers using a pre-parsed URI and stores the response in a buffer object.
 
bool DoGetEx (ParsedURI &TheUri, const char *headers, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request with custom headers using a pre-parsed URI and stores the response in a buffer object.
 
bool DoHttpEx (HttpMethod method, ParsedURI &TheUri, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with custom headers using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using a pre-parsed URI object and allows custom headers to be included in the request. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation that accepts a buffer_object.
 
bool DoGetEx (ParsedURI &TheUri, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request with custom headers using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP GET request using a pre-parsed URI object and allows custom headers to be included in the request. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation.
 
bool DoHttp (HttpMethod method, const char *pUrl, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP/HTTPS request using the specified method and stores the response in a buffer object.
 
bool DoGet (const char *pUrl, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP/HTTPS GET request and stores the response in a buffer object.
 
bool DoHttp (HttpMethod method, const char *pUrl, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Performs an HTTP request using the specified method and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the given method to the specified URL and stores the complete response body in the provided NBString reference. The function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttp implementation.
 
bool DoGet (const char *pUrl, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Performs an HTTP GET request and stores the result in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This overload provides a convenient way to perform HTTP GET requests when you want to store the response directly in an NBString object. The function wraps the NBString in a StringBufferObject and delegates to the main DoHttp function.
 
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)
 Executes an HTTP GET request with custom headers using a URL string and stores the response in a buffer object.
 
bool DoHttpEx (HttpMethod method, const char *pUrl, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with custom headers using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method and custom headers using a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation. This provides maximum flexibility for HTTP operations with custom headers and string-based response handling.
 
bool DoGetEx (const char *pUrl, const char *headers, NBString &result_string, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request with custom headers using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP GET request with custom headers using a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation. This provides a simple interface for GET requests that require custom headers with string-based response handling.
 
int DoHttp (HttpMethod method, ParsedURI &TheUri, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request using a pre-parsed URI and stores the response in a raw buffer.
 
int DoHttpEx (HttpMethod method, ParsedURI &TheUri, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with custom headers using a pre-parsed URI and stores the response in a raw buffer.
 
int DoHttp (HttpMethod method, const char *pUrl, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request using a URL string and stores the response in a raw buffer.
 
int DoHttpEx (HttpMethod method, const char *pUrl, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP request with custom headers using a URL string and stores the response in a raw buffer.
 
int DoGet (ParsedURI &TheUri, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request using a pre-parsed URI and stores the response in a raw buffer.
 
int DoGetEx (ParsedURI &TheUri, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request with custom headers using a pre-parsed URI and stores the response in a raw buffer.
 
int DoGet (const char *pUrl, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request using a URL string and stores the response in a raw buffer.
 
int DoGetEx (const char *pUrl, const char *headers, unsigned char *result, int maxl, uint16_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Executes an HTTP GET request with custom headers using a URL string and stores the response in a raw buffer.
 
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)
 Generates a Base64-encoded HTTP Basic Authentication header string for inclusion in HTTP requests.
 
int StartConnection (ParsedURI &TheUri, uint32_t timeout=TICKS_PER_SECOND *10)
 Establishes a TCP/TLS connection to a host using a pre-parsed URI with timeout specified in ticks.
 
int WriteHttpRequestHeaders (int fd, ParsedURI &uri, const char *methodStr, int content_len=0, const char *content_type=0, const char *extra_header=0)
 Writes HTTP request headers to an established connection file descriptor.
 
int StartTransaction (ParsedURI &TheUri, const char *headers=0, const char *action="GET", uint32_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Initiates an HTTP transaction using a pre-parsed URI by establishing a connection and sending request headers.
 
int StartTransaction (const char *pUrl, const char *headers=0, const char *action="GET", uint32_t TIMEOUT_WAIT=10 *TICKS_PER_SECOND)
 Initiates an HTTP transaction using a URL string by establishing a connection and sending request headers.
 
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)
Executes an HTTP GET request using a pre-parsed URI and stores the response in a buffer object.
Definition http_funcs.h:2070

#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)
{
OSTimeDly(TICKS_PER_SECOND * 1);
}
}
Parsed Uniform Resource Identifier Class (URI)
Definition http_funcs.h:62
#define MAIN_PRIO
Recommend UserMain priority.
Definition constants.h:130
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

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>

Executes an HTTP/HTTPS GET request and stores the response in a buffer object.

This function performs an HTTP GET request to the specified URL and stores the complete response body in the provided buffer object. The URL is parsed to extract the host information, and DNS resolution is performed automatically if a hostname is provided instead of an IP address. This is a convenience wrapper around the generic DoHttp function.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size.
See also
DoHttp() for the underlying HTTP implementation
buffer_object for response buffer management

◆ DoGet() [2/6]

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

#include <http_funcs.h>

Performs an HTTP GET request and stores the result in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This overload provides a convenient way to perform HTTP GET requests when you want to store the response directly in an NBString object. The function wraps the NBString in a StringBufferObject and delegates to the main DoHttp function.

Parameters
pUrlPointer to null-terminated string containing the URL to request
result_stringReference to NBString in which to store the HTTP response
TIMEOUT_WAITTimeout value in system ticks (default: 10 seconds)
Returns
true if the HTTP request was successful, false otherwise
See also
DoHttp()
StringBufferObject
NBString

◆ 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>

Executes an HTTP GET request using a URL string and stores the response in a raw buffer.

This is a low-level HTTP GET function that performs an HTTP GET request using a URL string and stores the response body in a provided raw buffer. The function handles URL parsing and DNS resolution automatically if needed. The response is written directly to the buffer without any additional processing or wrapper objects, providing direct access to the raw HTTP response data with minimal overhead.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. The response may be truncated if it exceeds the maxl parameter.
See also
DoHttp() for the underlying HTTP implementation
DoGet(ParsedURI&, unsigned char*, int, uint16_t) for pre-parsed URI version
DoGet(const char*, buffer_object&, uint16_t) for buffer_object version

◆ DoGet() [4/6]

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

#include <http_funcs.h>

Executes an HTTP GET request using a pre-parsed URI and stores the response in a buffer object.

This function performs an HTTP GET request using a pre-parsed URI object and stores the complete response body in the provided buffer object. This is a convenience wrapper around the generic DoHttp function, providing a simple interface for GET requests while leveraging pre-parsed URI components for improved performance when making multiple requests to the same host by avoiding repeated URL parsing operations.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
DoHttp() for the underlying HTTP implementation
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoGet(const char*, buffer_object&, uint16_t) for string URL overload
DoGetEx() for GET requests with custom headers support

◆ DoGet() [5/6]

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

#include <http_funcs.h>

Executes an HTTP GET request using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP GET request using a pre-parsed URI object and stores the complete response body in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttp implementation. Using a pre-parsed URI can improve performance when making multiple requests to the same host by avoiding repeated URL parsing operations.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
DoHttp() for the underlying HTTP implementation
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoGet(const char*, NBString&, uint16_t) for string URL overload
DoGetEx() for GET requests with custom headers support

◆ 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>

Executes an HTTP GET request using a pre-parsed URI and stores the response in a raw buffer.

This is a low-level HTTP GET function that performs an HTTP GET request using a pre-parsed URI object and stores the response body in a provided raw buffer. This function provides optimal performance by using pre-parsed URI components, eliminating URL parsing and DNS lookup overhead when making multiple GET requests to the same host. The response is written directly to the buffer without any additional processing or wrapper objects.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, connection error, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. Using pre-parsed URIs improves performance for repeated requests to the same host. The response may be truncated if it exceeds the maxl parameter.
See also
DoHttp() for the underlying HTTP implementation
ParsedURI for URL parsing and component access
DoGet(const char*, unsigned char*, int, uint16_t) for string URL version
DoGet(ParsedURI&, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP GET request with custom headers using a URL string and stores the response in a buffer object.

This function performs an HTTP GET request with custom headers using a URL string and stores the complete response body in the provided buffer object. This is a convenience wrapper around the generic DoHttpEx function, specifically optimized for GET operations with custom header support. The URL string will be parsed internally and DNS resolution will be performed automatically if needed, making this ideal for GET requests that require additional headers such as authentication, user-agent, or content negotiation.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Custom headers must be properly formatted without trailing CRLF on the final header.
See also
DoHttpEx() for the underlying HTTP implementation with full method support
buffer_object for response buffer management
DoGet(const char*, buffer_object&, uint16_t) for GET requests without custom headers
DoGetEx(ParsedURI&, const char*, buffer_object&, uint16_t) for pre-parsed URI version

◆ 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>

Executes an HTTP GET request with custom headers using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP GET request with custom headers using a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation. This provides a simple interface for GET requests that require custom headers with string-based response handling.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Custom headers must be properly formatted without trailing CRLF on the final header.
See also
DoHttpEx(HttpMethod, const char*, const char*, NBString&, uint16_t) for the underlying generic method implementation
StringBufferObject for response handling details
DoGet(const char*, NBString&, uint16_t) for GET requests without custom headers
DoGetEx(ParsedURI&, const char*, NBString&, uint16_t) for pre-parsed URI version

◆ 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>

Executes an HTTP GET request with custom headers using a URL string and stores the response in a raw buffer.

This is a low-level extended HTTP GET function that performs an HTTP GET request with custom headers using a URL string and stores the response body in a provided raw buffer. The function handles URL parsing and DNS resolution automatically while supporting custom headers for authentication, content negotiation, or other advanced GET operations. The response is written directly to the buffer without any additional processing.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. Custom headers must be properly formatted without trailing CRLF on the final header. The response may be truncated if it exceeds the maxl parameter.
See also
DoHttpEx() for the underlying HTTP implementation
DoGetEx(ParsedURI&, const char*, unsigned char*, int, uint16_t) for pre-parsed URI version
DoGetEx(const char*, const char*, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP GET request with custom headers using a pre-parsed URI and stores the response in a buffer object.

This function performs an HTTP GET request using a pre-parsed URI object and allows custom headers to be included in the request. The complete response body is stored in the provided buffer object. This is a convenience wrapper around the generic DoHttpEx function, providing enhanced control over the request headers while using pre-parsed URI components for improved performance when making multiple requests to the same host.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Headers must be properly formatted without trailing CRLF on the final header. Using pre-parsed URIs can improve performance for repeated requests to the same host.
See also
DoHttpEx() for the underlying HTTP implementation with full method support
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoGet() for simpler GET requests without custom headers

◆ 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>

Executes an HTTP GET request with custom headers using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP GET request using a pre-parsed URI object and allows custom headers to be included in the request. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, etc.)
headersPointer to null-terminated string containing custom HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no custom headers are needed
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the GET request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Custom headers must be properly formatted with CRLF line endings.
See also
DoHttpEx() for the underlying HTTP implementation with header support
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoGet() for simpler GET requests without custom headers

◆ 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>

Executes an HTTP GET request with custom headers using a pre-parsed URI and stores the response in a raw buffer.

This is a low-level extended HTTP GET function that performs an HTTP GET request with custom headers using a pre-parsed URI object and stores the response body in a provided raw buffer. This function provides optimal performance through pre-parsed URI components while supporting custom headers for authentication, content negotiation, or other advanced GET operations. The response is written directly to the buffer without any additional processing.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, connection error, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. Custom headers must be properly formatted without trailing CRLF on the final header. Using pre-parsed URIs improves performance for repeated requests to the same host. The response may be truncated if it exceeds the maxl parameter.
See also
DoHttpEx() for the underlying HTTP implementation
ParsedURI for URL parsing and component access
DoGetEx(const char*, const char*, unsigned char*, int, uint16_t) for string URL version
DoGetEx(ParsedURI&, const char*, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP/HTTPS request using the specified method and stores the response in a buffer object.

This function performs an HTTP request with the given method to the specified URL and stores the complete response body in the provided buffer object. The URL is parsed to extract the host information, port, and path components. DNS resolution is performed automatically if a hostname is provided instead of an IP address. This is the core HTTP client function that supports all standard HTTP methods.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, invalid URL, connection refused, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. For HTTPS URLs, SSL/TLS connection will be established automatically.
See also
HttpMethod for available HTTP methods
buffer_object for response buffer management
DoGet() for a GET-specific convenience wrapper
DoPost() for a POST-specific convenience wrapper

◆ 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>

Performs an HTTP request using the specified method and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the given method to the specified URL and stores the complete response body in the provided NBString reference. The function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttp implementation.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for available options
pUrlPointer to null-terminated string containing the target URL
result_stringReference to NBString in which to store the HTTP response body
TIMEOUT_WAITOptional timeout in system ticks (default: 10 seconds) Use TICKS_PER_SECOND to convert from seconds to ticks
Returns
true if the HTTP request completed successfully, false on failure (timeout, network error, or HTTP error response)
Note
The result_string will be cleared and populated with the response data. For large responses, ensure sufficient memory is available.
See also
DoHttp(HttpMethod, const char*, StringBufferObject&, uint16_t) for the underlying implementation
DoGet() for a GET-specific convenience function
DoPost() for a POST-specific convenience function
StringBufferObject for response handling details
HttpMethod for available HTTP methods

◆ 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>

Executes an HTTP request using a URL string and stores the response in a raw buffer.

This is a low-level HTTP client function that performs an HTTP request with the specified method using a URL string and stores the response body in a provided raw buffer. The function handles URL parsing and DNS resolution automatically if needed. The response is written directly to the buffer without any additional processing or wrapper objects, providing direct access to the raw HTTP response data.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. The response may be truncated if it exceeds the maxl parameter.
See also
HttpMethod for available HTTP methods
DoHttp(HttpMethod, ParsedURI&, unsigned char*, int, uint16_t) for pre-parsed URI version
DoHttp(HttpMethod, const char*, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP request using a pre-parsed URI and stores the response in a buffer object.

This is the core HTTP client function that performs an HTTP request with the specified method using a pre-parsed URI object and stores the complete response body in the provided buffer object. This function provides enhanced performance by using pre-parsed URI components, eliminating the overhead of repeated URL parsing when making multiple requests to the same host. It supports all standard HTTP methods and handles the complete request/response cycle.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, fragment, etc.)
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, invalid method, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. For HTTPS URLs, SSL/TLS connection will be established automatically. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoHttp(HttpMethod, const char*, buffer_object&, uint16_t) for string URL overload
DoHttpEx() for requests with custom headers support

◆ 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>

Executes an HTTP request using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using a pre-parsed URI object and stores the complete response body in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttp implementation that accepts a buffer_object. Using a pre-parsed URI can improve performance when making multiple requests to the same host by avoiding repeated URL parsing operations.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
DoHttp(HttpMethod, ParsedURI&, buffer_object&, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoHttp(HttpMethod, const char*, NBString&, uint16_t) for string URL overload
DoHttpEx() for requests with custom headers support

◆ 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>

Executes an HTTP request using a pre-parsed URI and stores the response in a raw buffer.

This is a low-level HTTP client function that performs an HTTP request with the specified method using a pre-parsed URI object and stores the response body in a provided raw buffer. This function provides optimal performance by using pre-parsed URI components, eliminating URL parsing and DNS lookup overhead when making multiple requests to the same host. The response is written directly to the buffer without any additional processing or wrapper objects.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, connection error, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. Using pre-parsed URIs improves performance for repeated requests to the same host. The response may be truncated if it exceeds the maxl parameter.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
DoHttp(HttpMethod, const char*, unsigned char*, int, uint16_t) for string URL version
DoHttp(HttpMethod, ParsedURI&, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP request with custom headers using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method and custom headers using a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation. This provides maximum flexibility for HTTP operations with custom headers and string-based response handling.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Custom headers must be properly formatted without trailing CRLF on the final header.
See also
DoHttpEx(HttpMethod, const char*, const char*, buffer_object&, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
StringBufferObject for response handling details
DoHttp(HttpMethod, const char*, NBString&, uint16_t) for requests without custom headers

◆ 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>

Executes an HTTP request with custom headers using a URL string and stores the response in a raw buffer.

This is a low-level extended HTTP client function that performs an HTTP request with the specified method and custom headers using a URL string. The response body is stored in a provided raw buffer. The function handles URL parsing and DNS resolution automatically if needed while supporting custom headers for authentication, content negotiation, or other advanced HTTP operations. The response is written directly to the buffer without any additional processing.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. Custom headers must be properly formatted without trailing CRLF on the final header. The response may be truncated if it exceeds the maxl parameter.
See also
HttpMethod for available HTTP methods
DoHttpEx(HttpMethod, ParsedURI&, const char*, unsigned char*, int, uint16_t) for pre-parsed URI version
DoHttpEx(HttpMethod, const char*, const char*, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP request with custom headers using a pre-parsed URI and stores the response in a buffer object.

This is the core extended HTTP client function that performs an HTTP request with the specified method using a pre-parsed URI object and allows custom headers to be included in the request. The complete response body is stored in the provided buffer object. This function provides maximum flexibility and control over HTTP requests, supporting all standard HTTP methods, custom headers, and pre-parsed URIs for optimal performance when making multiple requests.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, fragment, etc.)
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, invalid method, malformed headers, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Headers must be properly formatted without trailing CRLF on the final header. This is the most comprehensive HTTP client function providing full control. For HTTPS URLs, SSL/TLS connection will be established automatically. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoHttp() for simpler requests without custom headers
DoGetEx() for GET-specific convenience wrapper
DoHttpEx(HttpMethod, ParsedURI&, const char*, NBString&, uint16_t) for NBString overload

◆ 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>

Executes an HTTP request with custom headers using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using a pre-parsed URI object and allows custom headers to be included in the request. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoHttpEx implementation that accepts a buffer_object.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing custom HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no custom headers are needed
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Custom headers must be properly formatted with CRLF line endings. This is the most flexible HTTP client function supporting all methods and custom headers.
See also
DoHttpEx(HttpMethod, ParsedURI&, const char*, buffer_object&, uint16_t) for the underlying implementation
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
HttpMethod for available HTTP methods
DoHttp() for simpler requests without custom headers
DoGetEx() for GET-specific convenience function

◆ 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>

Executes an HTTP request with custom headers using a pre-parsed URI and stores the response in a raw buffer.

This is a low-level extended HTTP client function that performs an HTTP request with the specified method and custom headers using a pre-parsed URI object. The response body is stored in a provided raw buffer. This function provides optimal performance through pre-parsed URI components while supporting custom headers for authentication, content negotiation, or other advanced HTTP operations. The response is written directly to the buffer without any additional processing.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing custom HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no custom headers are needed
resultPointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response
maxlMaximum length of the result buffer in bytes Response will be truncated if it exceeds this length
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
Number of bytes received and stored in the result buffer on success (>= 0), or a negative error code on failure (network error, timeout, connection error, or HTTP error response)
Note
The result buffer will contain the raw response body data. No null termination is added - treat as binary data. Custom headers must be properly formatted without trailing CRLF on the final header. Using pre-parsed URIs improves performance for repeated requests to the same host. The response may be truncated if it exceeds the maxl parameter.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
DoHttpEx(HttpMethod, const char*, const char*, unsigned char*, int, uint16_t) for string URL version
DoHttpEx(HttpMethod, ParsedURI&, const char*, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP request with raw JSON data using a URL string and stores the response in a buffer object.

This is the core JSON HTTP function for raw JSON string data that performs an HTTP request with the specified method using raw JSON data provided as a string and a URL string. The complete response body is stored in the provided buffer object. This function provides the foundation for JSON HTTP operations with pre-formatted JSON strings, supporting all standard HTTP methods while handling URL parsing and DNS resolution automatically. The JSON data is sent with the appropriate Content-Type header for proper server processing.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid, serialized JSON format
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted, serialized, and null-terminated.
See also
HttpMethod for available HTTP methods
buffer_object for response buffer management
DoJsonHttp(HttpMethod, ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for pre-parsed URI version
DoJsonPost(const char*, const char*, buffer_object&, const char*, uint16_t) for POST-specific convenience wrapper

◆ 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>

Executes an HTTP request with raw JSON data using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using raw JSON data provided as a string and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. The URL string will be parsed internally and DNS resolution will be performed automatically if needed, making this ideal for simple JSON operations with pre-formatted data.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid JSON format
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted and null-terminated.
See also
DoJsonHttp(HttpMethod, const char*, const char*, buffer_object&, const char*, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
StringBufferObject for response handling details
DoJsonHttp(HttpMethod, ParsedURI&, const char*, NBString&, const char*, uint16_t) for pre-parsed URI version

◆ 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>

Executes an HTTP request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core JSON HTTP function that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided buffer object. This function provides the foundation for programmatic JSON HTTP operations with string-based URLs, allowing dynamic construction and manipulation of JSON data before transmission. The URL string will be parsed internally and DNS resolution will be performed automatically if needed.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, JSON serialization error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The JSON data will be automatically serialized with Content-Type "application/json".
See also
HttpMethod for available HTTP methods
ParsedJsonDataSet for JSON data construction and management
buffer_object for response buffer management
DoJsonHttp(HttpMethod, ParsedURI&, ParsedJsonDataSet&, buffer_object&, const char*, uint16_t) for pre-parsed URI version
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>

Executes an HTTP request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides flexibility for programmatic JSON operations with string-based response handling and simplified URL specification.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, JSON serialization error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. The JSON data will be automatically serialized with Content-Type "application/json".
See also
DoJsonHttp(HttpMethod, const char*, ParsedJsonDataSet&, buffer_object&, const char*, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
ParsedJsonDataSet for JSON data construction and management
StringBufferObject for response handling details

◆ 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>

Executes an HTTP request with raw JSON data using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core JSON HTTP function for raw JSON string data that performs an HTTP request with the specified method using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided buffer object. This function provides the foundation for JSON HTTP operations with pre-formatted JSON strings, offering optimal performance through pre-parsed URI components while supporting all standard HTTP methods.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid JSON format
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted and null-terminated. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoJsonHttp(HttpMethod, const char*, const char*, buffer_object&, const char*, uint16_t) for string URL version

◆ 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>

Executes an HTTP request with raw JSON data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides flexibility for JSON operations with pre-formatted JSON strings and string-based response handling.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid JSON format
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted and null-terminated.
See also
DoJsonHttp(HttpMethod, ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
StringBufferObject for response handling details

◆ 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>

Executes an HTTP request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core JSON HTTP function that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided buffer object. This function provides the foundation for programmatic JSON HTTP operations, allowing dynamic construction and manipulation of JSON data before transmission. The ParsedJsonDataSet will be automatically serialized to JSON format for the request body.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, JSON serialization error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The JSON data will be automatically serialized with Content-Type "application/json". Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
ParsedJsonDataSet for JSON data construction and management
buffer_object for response buffer management

◆ 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>

Executes an HTTP request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides flexibility for programmatic JSON operations with string-based response handling.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, JSON serialization error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. The JSON data will be automatically serialized with Content-Type "application/json".
See also
DoJsonHttp(HttpMethod, ParsedURI&, ParsedJsonDataSet&, buffer_object&, const char*, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
ParsedJsonDataSet for JSON data construction and management
StringBufferObject for response handling details

◆ 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>

Executes an HTTP request with JSON data from a file fragment using a URL string and stores the response in a buffer object.

This is the core JSON HTTP file function that performs an HTTP request with the specified method using JSON data loaded from a file fragment and a URL string. The complete response body is stored in the provided buffer object. This function supports JSON file templates with dynamic variable substitution, function callbacks, and other advanced features similar to the NetBurner web server system. The URL string will be parsed internally and DNS resolution will be performed automatically if needed.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
FragmentNamePointer to null-terminated string specifying the name of the file fragment containing the JSON template data with optional variable substitutions
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, fragment not found, template processing error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The JSON file fragment supports template processing with variable substitution. Content-Type header is automatically set to "application/json" for the request.
See also
HttpMethod for available HTTP methods
buffer_object for response buffer management
DoJsonHttpFile(HttpMethod, ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for pre-parsed URI version

◆ 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>

Performs an HTTP request and stores JSON response in an NBString This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that wraps the result NBString in a StringBufferObject and calls the main DoJsonHttpFile function.

Parameters
methodHTTP method to use (GET, POST, PUT, DELETE, etc.)
pUrlURL to send the HTTP request to
FragmentNameName of the JSON fragment to extract from response
result_stringReference to NBString in which to store the result
AdditionalHeadersAdditional HTTP headers to include in the request (can be NULL)
TIMEOUT_WAITTimeout value in system ticks (default: 10 seconds)
Returns
true if the HTTP request was successful and JSON was parsed, false otherwise
See also
DoJsonHttpFile(HttpMethod, const char*, const char*, StringBufferObject&, const char*, uint16_t)

◆ 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>

Sends an HTTP request and processes JSON response using a pre-parsed URI.

This function performs HTTP operations with JSON response processing using a pre-parsed URI object, providing more control and efficiency when the same URI will be used multiple times. It supports various HTTP methods (Post, Put, Patch) commonly used in REST API operations for creating, updating, and modifying resources. The function establishes an HTTP connection to the specified URI, sends the request with any additional headers, waits for the server response within the specified timeout period, and then parses the JSON response to extract only the requested fragment. This selective extraction reduces memory usage and processing overhead when dealing with large JSON responses. The use of a pre-parsed URI object eliminates repeated URI parsing overhead and provides better performance for repeated requests to the same endpoint. The function handles all aspects of the HTTP transaction including error conditions, timeouts, and malformed responses.

Parameters
methodHTTP method to use (Post, Put, or Patch)
TheUriReference to the pre-parsed URI object containing host, port, and path information
FragmentNameName of the JSON fragment to extract from the response
result_bufferReference to the buffer object where the result will be stored
AdditionalHeadersAdditional HTTP headers to include in the request (may be NULL)
TIMEOUT_WAITTimeout in system ticks to wait for response (default: 10 seconds)
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>

Executes an HTTP request with JSON data from a file fragment using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using JSON data loaded from a file fragment and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttpFile implementation. This approach provides maximum flexibility for JSON-based HTTP operations with pre-stored data fragments.

Parameters
methodHTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
FragmentNamePointer to null-terminated string specifying the name of the file fragment containing the JSON data to be sent in the request body
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, fragment not found, invalid method, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. The specified file fragment must exist and contain valid JSON data. Content-Type header is automatically set to "application/json" for the request.
See also
DoJsonHttpFile(HttpMethod, ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoJsonPostHttpFile() for POST-specific convenience wrapper

◆ 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>

Executes an HTTP POST request with raw JSON data using a URL string and stores the response in a buffer object.

This function performs an HTTP POST request using raw JSON data provided as a string and a URL string. The complete response body is stored in the provided buffer object. This is a convenience wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with pre-formatted JSON strings. This provides the most straightforward interface for JSON POST operations when you have serialized JSON data and want to use automatic URL parsing with buffer-based response handling.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid, serialized JSON format
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted, serialized, and null-terminated.
See also
DoJsonHttp() for the underlying generic method implementation
buffer_object for response buffer management
DoJsonPost(ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for pre-parsed URI version
DoJsonPost(const char*, const char*, NBString&, const char*, uint16_t) for NBString version

◆ 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>

Executes an HTTP POST request with raw JSON data using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using raw JSON data provided as a string and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides the simplest interface for JSON POST operations when you have pre-formatted JSON data and want string-based response handling with automatic URL parsing.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid JSON format
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted and null-terminated.
See also
DoJsonHttp(HttpMethod, const char*, const char*, NBString&, const char*, uint16_t) for the underlying generic method implementation
StringBufferObject for response handling details
DoJsonPost(ParsedURI&, const char*, NBString&, const char*, uint16_t) for pre-parsed URI version

◆ 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>

Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with programmatically constructed JSON data, providing a streamlined interface for common JSON API interactions.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the POST request body
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, JSON serialization error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The JSON data will be automatically serialized with Content-Type "application/json".
See also
DoJsonHttp() for the underlying generic method implementation
ParsedJsonDataSet for JSON data construction and management
buffer_object for response buffer management
DoJsonPost(ParsedURI&, ParsedJsonDataSet&, buffer_object&, const char*, uint16_t) for pre-parsed URI version
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>

Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides a simple interface for JSON POST operations with programmatically constructed data and string-based response handling.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the POST request body
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, JSON serialization error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. The JSON data will be automatically serialized with Content-Type "application/json".
See also
DoJsonHttp(HttpMethod, const char*, ParsedJsonDataSet&, NBString&, const char*, uint16_t) for the underlying generic method implementation
ParsedJsonDataSet for JSON data construction and management
StringBufferObject for response handling details
DoJsonPost(ParsedURI&, ParsedJsonDataSet&, NBString&, const char*, uint16_t) for pre-parsed URI version
JSON Lexer

◆ 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>

Executes an HTTP POST request with raw JSON data using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with pre-formatted JSON strings, providing a streamlined interface when you already have JSON data in string format.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid JSON format
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted and null-terminated.
See also
DoJsonHttp() for the underlying generic method implementation
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoJsonPost(ParsedURI&, ParsedJsonDataSet&, buffer_object&, const char*, uint16_t) for ParsedJsonDataSet version

◆ 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>

Executes an HTTP POST request with raw JSON data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using raw JSON data provided as a string and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This provides a simple interface for JSON POST operations with pre-formatted JSON strings and string-based response handling.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
Json_Data_To_PostPointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid JSON format
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no additional headers are needed (default: NULL)
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/json" for the request. The provided JSON string must be properly formatted and null-terminated.
See also
DoJsonHttp(HttpMethod, ParsedURI&, const char*, NBString&, const char*, uint16_t) for the underlying generic method implementation
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoJsonPost(ParsedURI&, ParsedJsonDataSet&, NBString&, const char*, uint16_t) for ParsedJsonDataSet version

◆ 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>

Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoJsonHttp function, specifically optimized for POST operations with programmatically constructed JSON data, providing a streamlined interface for common JSON API interactions.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
jsonoutReference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the POST request body
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, JSON serialization error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The JSON data will be automatically serialized with Content-Type "application/json".
See also
DoJsonHttp() for the underlying generic method implementation
ParsedURI for URL parsing and component access
ParsedJsonDataSet for JSON data construction and management
buffer_object for response buffer management

◆ 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>

Executes an HTTP POST request with JSON data from a ParsedJsonDataSet using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data from a ParsedJsonDataSet object and a pre-parsed URI. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttp implementation. This approach allows for dynamic JSON POST requests with programmatically constructed data.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
jsonoutReference to ParsedJsonDataSet containing the JSON data to be sent in the POST request body
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, JSON serialization error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. The JSON data will be automatically serialized and sent with Content-Type "application/json".
See also
DoJsonHttp() for the underlying JSON HTTP implementation
ParsedURI for URL parsing and component access
ParsedJsonDataSet for JSON data management
StringBufferObject for response handling details

◆ 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>

Executes an HTTP POST request with JSON data from a file fragment using a URL string and stores the response in a buffer object.

This function performs an HTTP POST request using JSON data loaded from a specified file fragment and a URL string. The complete response body is stored in the provided buffer object. This is a convenience wrapper around the generic DoJsonHttpFile function, providing a simple interface for JSON POST operations with file-based templates that support dynamic variable substitution, function callbacks, and other advanced processing features similar to the NetBurner web server system.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
FragmentNamePointer to null-terminated string specifying the name of the file fragment containing the JSON template data with optional variable substitutions
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, fragment not found, template processing error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The JSON file fragment supports template processing with variable substitution. Content-Type header is automatically set to "application/json" for the request.
See also
DoJsonHttpFile() for the underlying generic method implementation
buffer_object for response buffer management
DoJsonPostHttpFile(ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for pre-parsed URI version

◆ 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>

Performs an HTTP POST request and stores JSON response in an NBString This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience wrapper function that simplifies HTTP POST operations with JSON response handling. It internally calls DoJsonHttpFile with HttpMethod::Post and automatically manages the buffer conversion from NBString to StringBufferObject. The function handles the complete HTTP transaction including connection establishment, request transmission, response reception, and JSON parsing. Only the specified JSON fragment is extracted from the response and stored in the result string, making it efficient for retrieving specific data from larger JSON responses. The function is particularly useful for REST API interactions where you need to POST data and extract a specific piece of information from the JSON response.

Parameters
pUrlURL to send the HTTP POST request to
FragmentNameName of the JSON fragment to extract from response
result_stringReference to NBString where the result will be stored
AdditionalHeadersAdditional HTTP headers to include in the request (may be NULL)
TIMEOUT_WAITTimeout value in system ticks (default: 10 seconds)
Returns
true if the HTTP POST request succeeded and JSON was parsed successfully, false otherwise
See also
DoJsonHttpFile(HttpMethod, const char*, const char*, NBString&, const char*, uint16_t)

◆ 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>

Executes an HTTP POST request with JSON data from a file fragment using a pre-parsed URI and stores the response in a buffer object.

This function performs an HTTP POST request using JSON data loaded from a specified file fragment and a pre-parsed URI object. The complete response body is stored in the provided buffer object. This is a convenience wrapper around the generic DoJsonHttpFile function, specifically optimized for POST operations with pre-defined JSON data stored in file fragments, eliminating the need to construct JSON payloads programmatically.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
FragmentNamePointer to null-terminated string specifying the name of the file fragment containing the JSON data to be sent in the POST request body
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, fragment not found, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. The specified file fragment must exist and contain valid JSON data. Content-Type header is automatically set to "application/json" for the request.
See also
DoJsonHttpFile() for the underlying JSON HTTP implementation
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoJsonPostHttpFile(ParsedURI&, const char*, NBString&, const char*, uint16_t) for NBString overload

◆ 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>

Executes an HTTP POST request with JSON data from a file fragment using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request using JSON data loaded from a specified file fragment and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoJsonHttpFile implementation. This approach allows for efficient JSON POST requests with pre-defined data stored in file fragments.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
FragmentNamePointer to null-terminated string specifying the name of the file fragment containing the JSON data to be sent in the POST request body
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
AdditionalHeadersPointer to null-terminated string containing additional HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr or empty string if no additional headers are needed
TIMEOUT_WAITTimeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, fragment not found, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. The specified file fragment must exist and contain valid JSON data. Content-Type header is automatically set to "application/json" for the request.
See also
DoJsonHttpFile() for the underlying JSON HTTP implementation
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoJsonPostHttpFile(ParsedURI&, const char*, buffer_object&, const char*, uint16_t) for buffer_object overload

◆ DoMultipartBoundary()

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

#include <http_funcs.h>

Sends a multipart boundary section within an active multipart HTTP request.

This function sends a multipart boundary with content disposition headers but without any data payload as part of a multipart HTTP request. This is useful for creating empty form fields or marking section boundaries within the multipart stream according to the multipart/form-data specification. The boundary is properly formatted with the specified separator and disposition information.

Parameters
tcpfdTCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost()
DispositionContent-Disposition header value for this multipart section Should follow RFC format (e.g., "form-data; name=\"fieldname\"") Used to identify this section even though no data follows
separatorMultipart boundary separator string used to delimit sections Must be the same separator used throughout the entire multipart request
Note
This function must be called between DoMultipartStartPost() and DoMultipartFinished(). The TCP connection must remain active throughout the entire multipart sequence. The separator string must be consistent across all multipart operations in the same request. This creates a boundary marker without associated data content.
See also
DoMultipartStartPost() to initiate a multipart request
DoMultipartItem() to send boundary sections with data
DoMultipartFinished() to complete the request and receive the response

◆ 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>

Completes a multipart HTTP request and retrieves the server response in a buffer object.

This function finalizes a multipart HTTP request by sending the closing boundary, waiting for the server response, and parsing the complete response into the provided buffer object. This must be called after all multipart items and boundaries have been sent using DoMultipartItem() and DoMultipartBoundary() functions. The function handles the proper termination of the multipart stream and manages the HTTP response parsing.

Parameters
tcpfdTCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost()
separatorMultipart boundary separator string used throughout the request Must match the separator used in all previous multipart operations
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete server response
TIMEOUT_WAITTimeout in system ticks to wait for the server response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the request completed successfully with a 200 OK response containing a body, false on failure (network error, timeout, non-200 response, or parsing error)
Note
This function closes the multipart request and invalidates the TCP file descriptor. The result_buffer contents will be replaced with the server response data. Ensure the buffer object has sufficient capacity for the expected response size. A successful return indicates both proper multipart transmission and a valid HTTP response.
See also
DoMultipartStartPost() to initiate the multipart request sequence
DoMultipartItem() and DoMultipartBoundary() for sending multipart data
buffer_object for response buffer management

◆ 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>

Completes a multipart HTTP request and retrieves the server response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that finalizes a multipart HTTP request and stores the server response in an NBString reference. The function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoMultipartFinished implementation. This provides string-based response handling for multipart operations where text-based responses are expected.

Parameters
tcpfdTCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost()
separatorMultipart boundary separator string used throughout the request Must match the separator used in all previous multipart operations
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete server response
TIMEOUT_WAITTimeout in system ticks to wait for the server response (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
true if the request completed successfully with a 200 OK response containing a body, false on failure (network error, timeout, non-200 response, or parsing error)
Note
This function closes the multipart request and invalidates the TCP file descriptor. The result_string contents will be replaced with the server response data. For large responses, ensure sufficient memory is available. A successful return indicates both proper multipart transmission and a valid HTTP response.
See also
DoMultipartFinished(int, const char*, buffer_object&, uint16_t) for the underlying implementation
StringBufferObject for response handling details
DoMultipartStartPost() to initiate the multipart request sequence

◆ DoMultipartItem()

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

#include <http_funcs.h>

Sends a multipart data item within an active multipart HTTP request.

This function sends a single data item as part of a multipart HTTP request that was previously initiated with DoMultipartStartPost(). The function handles the proper formatting of the multipart boundary, content disposition headers, and the actual data payload according to the multipart/form-data specification. This allows for sending binary data, files, or form fields as individual parts of a larger multipart submission.

Parameters
tcpfdTCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost()
DispositionContent-Disposition header value for this multipart section Should follow RFC format (e.g., "form-data; name=\"fieldname\"") or "form-data; name=\"file\"; filename=\"example.txt\""
separatorMultipart boundary separator string used to delimit sections Must be the same separator used throughout the entire multipart request
dataPointer to the binary data to be sent in this multipart section Can contain any type of data including binary files or text
lenLength of the data in bytes Must accurately represent the size of the data buffer
Note
This function must be called between DoMultipartStartPost() and DoMultipartFinished(). The TCP connection must remain active throughout the entire multipart sequence. The separator string must be consistent across all multipart operations in the same request. Content-Type headers for individual parts can be included in the Disposition parameter.
See also
DoMultipartStartPost() to initiate a multipart request
DoMultipartBoundary() to send boundary-only sections
DoMultipartFinished() to complete the request and receive the response

◆ 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>

Initiates a multipart HTTP request using a URL string and returns a connection file descriptor.

This is the core multipart HTTP function that establishes an HTTP connection and begins a multipart request with the specified method using a URL string. The function performs URL parsing, DNS resolution if needed, establishes the TCP/TLS connection, and sends the initial HTTP headers including the multipart/form-data content type with the specified boundary separator. The returned file descriptor is used for subsequent multipart operations.

Parameters
methodHTTP method to use for the multipart request (POST, PUT, PATCH recommended) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames For HTTPS URLs, SSL/TLS connection will be established automatically
separatorMultipart boundary separator string used to delimit sections Must be unique and not appear in the actual data being transmitted Commonly generated as a random string or UUID
TIMEOUT_WAITTimeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion
contentLengthTotal content length for the entire multipart request in bytes If 0, chunked transfer encoding will be used (default: 0) If specified, must accurately represent the total payload size
Returns
TCP/TLS file descriptor (> 0) if connection was successfully established and headers sent, or a negative tcpSocketStatus error code on failure (connection error, DNS resolution failure, timeout, or HTTP protocol error)
Note
The returned file descriptor must be used with DoMultipartItem(), DoMultipartBoundary(), and DoMultipartFinished() to complete the multipart request sequence. The connection remains active until DoMultipartFinished() is called. If contentLength is specified, the total data sent must match exactly. The separator string must be consistent throughout all subsequent multipart operations.
See also
HttpMethod for available HTTP methods
DoMultipartItem() to send data items
DoMultipartBoundary() to send boundary markers
DoMultipartFinished() to complete the request and receive response
TCP Socket Status for error code definitions

◆ 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>

Initiates a multipart HTTP request using a pre-parsed URI and returns a connection file descriptor.

This is the core multipart HTTP function that establishes an HTTP connection and begins a multipart request with the specified method using a pre-parsed URI object. The function uses the pre-parsed URI components to establish the TCP/TLS connection directly, eliminating URL parsing overhead and providing optimal performance for repeated multipart requests to the same host. The function sends the initial HTTP headers including the multipart/form-data content type with the specified boundary separator.

Parameters
methodHTTP method to use for the multipart request (POST, PUT, PATCH recommended) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) For HTTPS schemes, SSL/TLS connection will be established automatically
separatorMultipart boundary separator string used to delimit sections Must be unique and not appear in the actual data being transmitted Commonly generated as a random string or UUID
TIMEOUT_WAITTimeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion
contentLengthTotal content length for the entire multipart request in bytes If 0, chunked transfer encoding will be used (default: 0) If specified, must accurately represent the total payload size
Returns
TCP/TLS file descriptor (> 0) if connection was successfully established and headers sent, or a negative tcpSocketStatus error code on failure (connection error, timeout, or HTTP protocol error)
Note
The returned file descriptor must be used with DoMultipartItem(), DoMultipartBoundary(), and DoMultipartFinished() to complete the multipart request sequence. Using pre-parsed URIs improves performance for repeated requests to the same host. The connection remains active until DoMultipartFinished() is called. If contentLength is specified, the total data sent must match exactly. The separator string must be consistent throughout all subsequent multipart operations.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
DoMultipartItem() to send data items
DoMultipartBoundary() to send boundary markers
DoMultipartFinished() to complete the request and receive response
TCP Socket Status for error code definitions
DoMultipartStartHttp(HttpMethod, const char*, const char*, uint16_t, uint32_t) for string URL version

◆ 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>

Initiates a multipart HTTP POST request using a URL string and returns a connection file descriptor.

This is a convenience function that establishes an HTTP POST connection and begins a multipart request using a URL string. This function provides the simplest interface for starting multipart POST operations, handling URL parsing, DNS resolution, connection establishment, and sending the initial HTTP headers with multipart/form-data content type. This is ideal for straightforward multipart file uploads or form submissions.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames For HTTPS URLs, SSL/TLS connection will be established automatically
separatorMultipart boundary separator string used to delimit sections Must be unique and not appear in the actual data being transmitted Commonly generated as a random string or UUID
TIMEOUT_WAITTimeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion
contentLengthTotal content length for the entire multipart request in bytes If 0, chunked transfer encoding will be used (default: 0) If specified, must accurately represent the total payload size
Returns
TCP/TLS file descriptor (> 0) if connection was successfully established and headers sent, or a negative tcpSocketStatus error code on failure (connection error, DNS resolution failure, timeout, or HTTP protocol error)
Note
The returned file descriptor must be used with DoMultipartItem(), DoMultipartBoundary(), and DoMultipartFinished() to complete the multipart request sequence. If contentLength is specified, the total data sent must match exactly. The separator string must be consistent throughout all subsequent multipart operations.
See also
DoMultipartStartHttp() for the underlying generic method implementation
DoMultipartItem() to send data items
DoMultipartBoundary() to send boundary markers
DoMultipartFinished() to complete the request and receive response
TCP Socket Status for error code definitions

◆ 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>

Initiates a multipart HTTP POST request using a pre-parsed URI and returns a connection file descriptor.

This is a convenience function that establishes an HTTP POST connection and begins a multipart request using a pre-parsed URI object. This function provides enhanced performance by using pre-parsed URI components, eliminating URL parsing overhead when making multiple multipart requests to the same host. The function establishes the connection and sends the initial HTTP headers with multipart/form-data content type.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
separatorMultipart boundary separator string used to delimit sections Must be unique and not appear in the actual data being transmitted Commonly generated as a random string or UUID
TIMEOUT_WAITTimeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion
contentLengthTotal content length for the entire multipart request in bytes If 0, chunked transfer encoding will be used (default: 0) If specified, must accurately represent the total payload size
Returns
TCP/TLS file descriptor (> 0) if connection was successfully established and headers sent, or a negative tcpSocketStatus error code on failure (connection error, timeout, or HTTP protocol error)
Note
The returned file descriptor must be used with DoMultipartItem(), DoMultipartBoundary(), and DoMultipartFinished() to complete the multipart request sequence. Using pre-parsed URIs improves performance for repeated requests to the same host. If contentLength is specified, the total data sent must match exactly. The separator string must be consistent throughout all subsequent multipart operations.
See also
DoMultipartStartHttp() for the underlying generic method implementation
ParsedURI for URL parsing and component access
DoMultipartItem() to send data items
DoMultipartBoundary() to send boundary markers
DoMultipartFinished() to complete the request and receive response
TCP Socket Status for error code definitions

◆ 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>

Executes an HTTP request with URL-encoded form data using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is the core URL-encoded form HTTP function that performs an HTTP request with the specified method using URL-encoded form data and a URL string. The complete response body is stored in the provided buffer object. This function provides the foundation for form-based HTTP operations, supporting all standard HTTP methods while handling URL parsing and DNS resolution automatically. The form data is sent with the appropriate Content-Type header for proper server processing of web form submissions.

Parameters
methodHTTP method to use for the request (POST recommended for form data) See HttpMethod enumeration for all supported methods
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no custom headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function.
See also
HttpMethod for available HTTP methods
buffer_object for response buffer management
DoUrlEncodedFormHttp(HttpMethod, ParsedURI&, char*, char*, buffer_object&, uint16_t) for pre-parsed URI version
DoUrlEncodedFormPost(const char*, char*, char*, buffer_object&, uint16_t) for POST-specific convenience wrapper

◆ 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>

Executes an HTTP request with URL-encoded form data using a pre-parsed URI and stores the response in a buffer object.

This is the core URL-encoded form HTTP function that performs an HTTP request with the specified method using URL-encoded form data and a pre-parsed URI object. The complete response body is stored in the provided buffer object. This function provides the foundation for form-based HTTP operations with optimal performance through pre-parsed URI components, supporting all standard HTTP methods while eliminating the overhead of repeated URL parsing when making multiple form submissions to the same host.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for form data) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr if no additional headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoUrlEncodedFormHttp(HttpMethod, const char*, char*, char*, buffer_object&, uint16_t) for string URL version

◆ 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>

Executes an HTTP request with URL-encoded form data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP request with the specified method using URL-encoded form data and a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoUrlEncodedFormHttp implementation. This provides flexibility for form-based HTTP operations with pre-parsed URIs and string-based response handling.

Parameters
methodHTTP method to use for the request (POST, PUT, PATCH recommended for form data) See HttpMethod enumeration for all supported methods
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr if no additional headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the HTTP request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
DoUrlEncodedFormHttp(HttpMethod, ParsedURI&, char*, char*, buffer_object&, uint16_t) for the underlying implementation
HttpMethod for available HTTP methods
ParsedURI for URL parsing and component access
StringBufferObject for response handling details

◆ 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>

Executes an HTTP POST request with URL-encoded form data using a URL string and stores the response in a buffer object. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request with URL-encoded form data using a URL string. The complete response body is stored in the provided buffer object. This function is a simple wrapper around the generic DoUrlEncodedFormHttp function, specifically optimized for POST operations with form data. This provides the most straightforward interface for web form submissions when you have URL-encoded form data and want to use automatic URL parsing with buffer-based response handling.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no custom headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function.
See also
DoUrlEncodedFormHttp() for the underlying generic method implementation
buffer_object for response buffer management
DoUrlEncodedFormPost(ParsedURI&, char*, char*, buffer_object&, uint16_t) for pre-parsed URI version
DoUrlEncodedFormPost(const char*, char*, char*, NBString&, uint16_t) for NBString version

◆ 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>

Executes an HTTP POST request with URL-encoded form data using a URL string and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request with URL-encoded form data using a URL string. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoUrlEncodedFormHttp implementation. This provides a simple interface for form-based POST operations with string-based response handling.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no custom headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, DNS resolution failure, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function.
See also
DoUrlEncodedFormHttp() for the underlying generic method implementation
StringBufferObject for response handling details
DoUrlEncodedFormPost(const char*, char*, char*, buffer_object&, uint16_t) for buffer_object version

◆ 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>

Executes an HTTP POST request with URL-encoded form data using a pre-parsed URI and stores the response in a buffer object.

This function performs an HTTP POST request with URL-encoded form data using a pre-parsed URI object. The complete response body is stored in the provided buffer object. This is a convenience wrapper around the generic DoUrlEncodedFormHttp function, specifically optimized for POST operations with form data. This provides enhanced performance for web form submissions by using pre-parsed URI components, eliminating URL parsing overhead for repeated submissions to the same endpoint.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing additional HTTP headers Multiple headers should be concatenated and separated by "\r\n" Do not include trailing "\r\n" after the last header Pass nullptr if no additional headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding
result_bufferReference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_buffer contents will be replaced with the response data. Ensure the buffer object has sufficient capacity for the expected response size. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
DoUrlEncodedFormHttp() for the underlying generic method implementation
ParsedURI for URL parsing and component access
buffer_object for response buffer management
DoUrlEncodedFormPost(const char*, char*, char*, buffer_object&, uint16_t) for string URL version

◆ DoUrlEncodedFormPost() [4/4]

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

#include <http_funcs.h>

Executes an HTTP POST request with URL-encoded form data using a pre-parsed URI and stores the response in an NBString. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is a convenience overload that performs an HTTP POST request with URL-encoded form data using a pre-parsed URI object. The complete response body is stored in the provided NBString reference. This function uses a StringBufferObject internally to handle the response data collection and forwards the call to the underlying DoUrlEncodedFormHttp implementation. Using a pre-parsed URI can improve performance when making multiple form submissions to the same host by avoiding repeated URL parsing operations.

Parameters
TheUriReference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.)
headersPointer to null-terminated string containing HTTP headers Headers should be formatted as "Header: Value\r\n" pairs Pass nullptr if no custom headers are needed
form_dataPointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format
result_stringReference to NBString in which to store the HTTP response body The string will be populated with the complete response data
TIMEOUT_WAITTimeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks
Returns
true if the POST request completed successfully and response was received, false on failure (network error, timeout, connection error, or HTTP error response)
Note
The result_string contents will be replaced with the response data. For large responses, ensure sufficient memory is available. Content-Type header is automatically set to "application/x-www-form-urlencoded". Form data must be properly URL-encoded before passing to this function. Using pre-parsed URIs improves performance for repeated requests to the same host.
See also
DoUrlEncodedFormHttp() for the underlying generic method implementation
ParsedURI for URL parsing and component access
StringBufferObject for response handling details
DoUrlEncodedFormPost(const char*, char*, char*, NBString&, uint16_t) for string URL version

◆ PopulateAuthHeader()

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

#include <http_funcs.h>

Generates a Base64-encoded HTTP Basic Authentication header string for inclusion in HTTP requests.

This function creates a properly formatted HTTP Basic Authentication header by combining the provided username and password, encoding them using Base64, and formatting the result as an "Authorization: Basic" header string. The generated header can be used directly in HTTP requests that require Basic Authentication. The function handles the complete authentication header construction according to RFC 7617 specifications.

Parameters
userPointer to null-terminated string containing the username Must not contain colon characters as they are used as delimiters
passwordPointer to null-terminated string containing the password Can be empty string for username-only authentication scenarios
bufferPointer to destination buffer where the formatted authentication header will be written Buffer will contain "Authorization: Basic <base64-credentials>" format
maxlenMaximum number of characters that can be written to the buffer including null terminator Must be sufficient to hold the complete formatted header string
Returns
Number of characters written to the buffer (excluding null terminator) on success, or a negative value if the buffer was insufficient to hold the complete header string
Note
The generated header string is null-terminated and ready for direct use in HTTP requests. The buffer must be large enough to accommodate the Base64-encoded credentials plus header formatting. Base64 encoding increases the size of the credentials by approximately 33%. The function does not validate credential format - ensure username does not contain colons. This implements HTTP Basic Authentication which transmits credentials in encoded but not encrypted form.
See also
WriteHttpRequestHeaders() for incorporating the generated header into HTTP requests
RFC 7617 for HTTP Basic Authentication specification details

◆ 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.

◆ StartConnection()

int StartConnection ( ParsedURI & TheUri,
uint32_t timeout = TICKS_PER_SECOND*10 )
inline

#include <http_funcs.h>

Establishes a TCP/TLS connection to a host using a pre-parsed URI with timeout specified in ticks.

This is a convenience overload that establishes a connection to the host specified in the pre-parsed URI object using a timeout value expressed in system ticks. The function creates a TickTimeout object internally and forwards the call to the underlying StartConnection implementation. This provides a simple interface for connection establishment when you need to specify timeout in system ticks rather than using a TickTimeout object directly.

Parameters
TheUriReference to ParsedURI object containing the connection details (host, port, scheme for HTTP/HTTPS selection)
timeoutConnection timeout in system ticks (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
TCP/TLS file descriptor (> 0) if connection was successfully established, or a negative error code on failure (connection refused, timeout, DNS resolution failure, or network error)
Note
For HTTPS URLs, SSL/TLS connection will be established automatically. The returned file descriptor must be properly closed when no longer needed. Connection timeout includes both DNS resolution and TCP connection establishment time.
See also
StartConnection(ParsedURI&, TickTimeout&) for the underlying implementation
ParsedURI for URL parsing and component access
TickTimeout for timeout management

◆ StartTransaction() [1/2]

int StartTransaction ( const char * pUrl,
const char * headers = 0,
const char * action = "GET",
uint32_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Initiates an HTTP transaction using a URL string by establishing a connection and sending request headers.

This function performs the initial phase of an HTTP request by parsing the provided URL, establishing a connection to the specified host, and sending the HTTP request headers including the request line, Host header, and any additional custom headers. The function returns a file descriptor for the established connection that can be used to send request body data (if needed) and receive the server response. This provides a simple interface for starting HTTP transactions with automatic URL parsing and DNS resolution.

Parameters
pUrlPointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames
headersPointer to null-terminated string containing additional HTTP headers Headers should be formatted without leading or trailing "\r\n" Each header should be on a separate line with "\r\n" between headers Pass nullptr if no additional headers are needed (default: nullptr)
actionPointer to null-terminated string containing the HTTP method (default: "GET"). Common values: "GET", "POST", "PUT", "DELETE"
TIMEOUT_WAITTimeout in system ticks for URL parsing, connection establishment, and header transmission (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
TCP/TLS file descriptor (> 0) if connection was established and headers sent successfully, or a negative error code on failure (URL parsing error, DNS resolution failure, connection error, timeout, or header transmission failure)
Note
The returned file descriptor can be used to send request body data and receive responses. The Host header is automatically included based on the parsed URL information. For HTTPS URLs, SSL/TLS connection will be established automatically. The connection remains active until explicitly closed. Custom headers must be properly formatted without leading/trailing CRLF.
See also
StartTransaction(ParsedURI&, const char*, const char*, uint32_t) for pre-parsed URI version

◆ StartTransaction() [2/2]

int StartTransaction ( ParsedURI & TheUri,
const char * headers = 0,
const char * action = "GET",
uint32_t TIMEOUT_WAIT = 10 *TICKS_PER_SECOND )

#include <http_funcs.h>

Initiates an HTTP transaction using a pre-parsed URI by establishing a connection and sending request headers.

This function performs the initial phase of an HTTP request by establishing a connection to the specified host and sending the HTTP request headers including the request line, Host header, and any additional custom headers. The function returns a file descriptor for the established connection that can be used to send request body data (if needed) and receive the server response. This provides low-level control over the HTTP transaction lifecycle with optimal performance through pre-parsed URI components.

Parameters
TheUriReference to ParsedURI object containing the connection and request details (host, port, path, scheme, query parameters)
headersPointer to null-terminated string containing additional HTTP headers Headers should be formatted without leading or trailing "\r\n" Each header should be on a separate line with "\r\n" between headers Pass nullptr if no additional headers are needed (default: nullptr)
actionPointer to null-terminated string containing the HTTP method (default: "GET"). Common values: "GET", "POST", "PUT", "DELETE"
TIMEOUT_WAITTimeout in system ticks for connection establishment and header transmission (default: 10 seconds). Use TICKS_PER_SECOND for conversion
Returns
TCP/TLS file descriptor (> 0) if connection was established and headers sent successfully, or a negative error code on failure (connection error, timeout, or header transmission failure)
Note
The returned file descriptor can be used to send request body data and receive responses. The Host header is automatically included based on the URI information. For HTTPS URLs, SSL/TLS connection will be established automatically. The connection remains active until explicitly closed. Custom headers must be properly formatted without leading/trailing CRLF.
See also
ParsedURI for URL parsing and component access
StartTransaction(const char*, const char*, const char*, uint32_t) for string URL version

◆ 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.

◆ WriteHttpRequestHeaders()

int WriteHttpRequestHeaders ( int fd,
ParsedURI & uri,
const char * methodStr,
int content_len = 0,
const char * content_type = 0,
const char * extra_header = 0 )

#include <http_funcs.h>

Writes HTTP request headers to an established connection file descriptor.

This function writes properly formatted HTTP request headers to an established TCP/TLS connection using information from a parsed URI object. The function constructs and sends the HTTP request line, Host header, and any additional headers as specified. This is typically used after establishing a connection but before sending any request body data. The headers are formatted according to HTTP/1.1 specification requirements.

Parameters
fdTCP/TLS file descriptor of an established connection Must be a valid descriptor returned from connection establishment functions
uriReference to ParsedURI object containing the request details (host, port, path, query parameters for request construction)
methodStrPointer to null-terminated string containing the HTTP method (e.g., "GET", "POST", "PUT", "DELETE")
content_lenContent length for the request body in bytes If 0, no Content-Length header is added (default: 0) If > 0, Content-Length header is automatically included
content_typePointer to null-terminated string containing the Content-Type header value If nullptr, no Content-Type header is added (default: nullptr) Common values include "application/json", "application/x-www-form-urlencoded"
extra_headerPointer to null-terminated string containing additional custom headers Multiple headers should be separated by "\r\n" If nullptr, no extra headers are added (default: nullptr)
Returns
Number of bytes written to the connection on success (> 0), or a negative error code on failure (write error, connection closed, or formatting error)
Note
The function automatically adds required HTTP/1.1 headers including Host header. Headers are properly terminated with "\r\n\r\n" to indicate end of header section. The connection must be established before calling this function. This function only writes headers - request body must be sent separately if needed. Custom headers in extra_header parameter must be properly formatted.
See also
StartConnection() to establish the initial connection
ParsedURI for URL parsing and component access