|
NetBurner 3.5.6
PDF Version |
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. | |
#include< http_funcs.h>
Functions for interacting with the web, like HTTP GET/POST requests.
#include< web_client.h>
Functions for instantiating a periodic web client
| bool DoActualClientRequest | ( | ParsedURI & | TheUri, |
| uint16_t & | next_time_delay ) |
#include <web_client.h>
Callback to specify for performing and handle a WebClient request.
| TheUri | Pointer to a ParsedURI object (representing the URL) |
| next_time_delay | Pointer to the number of ticks to wait before the next request |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated string containing the URL to request |
| result_string | Reference to NBString in which to store the HTTP response |
| TIMEOUT_WAIT | Timeout value in system ticks (default: 10 seconds) |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| result | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| result | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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 | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, etc.) |
| headers | Pointer 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_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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 | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| pUrl | Pointer to a URL string. A DNS lookup will be done if necessary. |
| TIMEOUT_WAIT | Timeout in in system time ticks to wait for a response. |
| int DoGetUpdate | ( | ParsedURI & | TheUri, |
| uint16_t | TIMEOUT_WAIT = 10 *TICKS_PER_SECOND ) |
#include <http_funcs.h>
Execute a firmware update from the specified URI.
| TheUri | Reference to the ParsedURI object. |
| TIMEOUT_WAIT | Timeout in in system time ticks to wait for a response. |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for available options |
| pUrl | Pointer to null-terminated string containing the target URL |
| result_string | Reference to NBString in which to store the HTTP response body |
| TIMEOUT_WAIT | Optional timeout in system ticks (default: 10 seconds) Use TICKS_PER_SECOND to convert from seconds to ticks |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| result | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, fragment, etc.) |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| result | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP Method to use |
| pUrl | Pointer to a URL string. A DNS lookup will be done if necessary. |
| headers | Additional 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_buffer | Reference to the memory buffer in which to store the result. |
| TIMEOUT_WAIT | Timeout in in system time ticks to wait for a response. |
|
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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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 | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, fragment, etc.) |
| headers | Pointer 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_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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 | Pointer to raw buffer where the HTTP response body will be stored Buffer must be pre-allocated with sufficient space for the response |
| maxl | Maximum length of the result buffer in bytes Response will be truncated if it exceeds this length |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid, serialized JSON format |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid JSON format |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid JSON format |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the request body. Must be valid JSON format |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the request body |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for JSON data) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| FragmentName | Pointer to null-terminated string specifying the name of the file fragment containing the JSON template data with optional variable substitutions |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| method | HTTP method to use (GET, POST, PUT, DELETE, etc.) |
| pUrl | URL to send the HTTP request to |
| FragmentName | Name of the JSON fragment to extract from response |
| result_string | Reference to NBString in which to store the result |
| AdditionalHeaders | Additional HTTP headers to include in the request (can be NULL) |
| TIMEOUT_WAIT | Timeout value in system ticks (default: 10 seconds) |
| 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.
| method | HTTP method to use (Post, Put, or Patch) |
| TheUri | Reference to the pre-parsed URI object containing host, port, and path information |
| FragmentName | Name of the JSON fragment to extract from the response |
| result_buffer | Reference to the buffer object where the result will be stored |
| AdditionalHeaders | Additional HTTP headers to include in the request (may be NULL) |
| TIMEOUT_WAIT | Timeout in system ticks to wait for response (default: 10 seconds) |
|
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.
| method | HTTP method to use for the request (GET, POST, PUT, DELETE, etc.) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| FragmentName | Pointer to null-terminated string specifying the name of the file fragment containing the JSON data to be sent in the request body |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid, serialized JSON format |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid JSON format |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the POST request body |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the POST request body |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid JSON format |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| Json_Data_To_Post | Pointer to null-terminated string containing the raw JSON data to be sent in the POST request body. Must be valid JSON format |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be serialized and sent in the POST request body |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| jsonout | Reference to ParsedJsonDataSet containing the JSON data to be sent in the POST request body |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| FragmentName | Pointer to null-terminated string specifying the name of the file fragment containing the JSON template data with optional variable substitutions |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| pUrl | URL to send the HTTP POST request to |
| FragmentName | Name of the JSON fragment to extract from response |
| result_string | Reference to NBString where the result will be stored |
| AdditionalHeaders | Additional HTTP headers to include in the request (may be NULL) |
| TIMEOUT_WAIT | Timeout value in system ticks (default: 10 seconds) |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| FragmentName | Pointer to null-terminated string specifying the name of the file fragment containing the JSON data to be sent in the POST request body |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| FragmentName | Pointer to null-terminated string specifying the name of the file fragment containing the JSON data to be sent in the POST request body |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| AdditionalHeaders | Pointer 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_WAIT | Timeout in system ticks to wait for the complete response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| tcpfd | TCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost() |
| Disposition | Content-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 |
| separator | Multipart boundary separator string used to delimit sections Must be the same separator used throughout the entire multipart request |
| 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.
| tcpfd | TCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost() |
| separator | Multipart boundary separator string used throughout the request Must match the separator used in all previous multipart operations |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete server response |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the server response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
|
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.
| tcpfd | TCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost() |
| separator | Multipart boundary separator string used throughout the request Must match the separator used in all previous multipart operations |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete server response |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the server response (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| tcpfd | TCP file descriptor of the active HTTP connection Must be a valid descriptor returned from DoMultipartStartPost() |
| Disposition | Content-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\"" |
| separator | Multipart boundary separator string used to delimit sections Must be the same separator used throughout the entire multipart request |
| data | Pointer to the binary data to be sent in this multipart section Can contain any type of data including binary files or text |
| len | Length of the data in bytes Must accurately represent the size of the data buffer |
| 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.
| method | HTTP method to use for the multipart request (POST, PUT, PATCH recommended) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer 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 |
| separator | Multipart 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_WAIT | Timeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| contentLength | Total 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 |
| 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.
| method | HTTP method to use for the multipart request (POST, PUT, PATCH recommended) See HttpMethod enumeration for all supported methods |
| TheUri | Reference 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 |
| separator | Multipart 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_WAIT | Timeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| contentLength | Total 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 |
|
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.
| pUrl | Pointer 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 |
| separator | Multipart 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_WAIT | Timeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| contentLength | Total 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 |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| separator | Multipart 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_WAIT | Timeout in system ticks for connection establishment and initial request (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| contentLength | Total 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 |
| 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.
| method | HTTP method to use for the request (POST recommended for form data) See HttpMethod enumeration for all supported methods |
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
| 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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for form data) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
|
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.
| method | HTTP method to use for the request (POST, PUT, PATCH recommended for form data) See HttpMethod enumeration for all supported methods |
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
|
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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format with proper URL encoding |
| result_buffer | Reference to buffer_object where the HTTP response body will be stored The buffer will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
|
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.
| TheUri | Reference to ParsedURI object containing the pre-parsed URL components (host, port, path, scheme, query parameters, etc.) |
| headers | Pointer 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_data | Pointer to null-terminated string containing URL-encoded form data Data should be in "key1=value1&key2=value2" format |
| result_string | Reference to NBString in which to store the HTTP response body The string will be populated with the complete response data |
| TIMEOUT_WAIT | Timeout in system ticks to wait for the complete response Use TICKS_PER_SECOND for conversion from seconds to ticks |
| 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.
| user | Pointer to null-terminated string containing the username Must not contain colon characters as they are used as delimiters |
| password | Pointer to null-terminated string containing the password Can be empty string for username-only authentication scenarios |
| buffer | Pointer to destination buffer where the formatted authentication header will be written Buffer will contain "Authorization: Basic <base64-credentials>" format |
| maxlen | Maximum number of characters that can be written to the buffer including null terminator Must be sufficient to hold the complete formatted header string |
| void SetHttpDiag | ( | bool | b | ) |
#include <http_funcs.h>
Enable/disable Web Client HTTP diagnostics to the console port.
| b | Set true to enable, false to disable. |
| void SetHttpDiag | ( | int | level | ) |
#include <http_funcs.h>
Enable/disable Web Client HTTP diagnostics to the console port.
| level | Set 1 to enable, 0 to disable, or 2 for extra verbosity. |
|
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.
| TheUri | Reference to ParsedURI object containing the connection details (host, port, scheme for HTTP/HTTPS selection) |
| timeout | Connection timeout in system ticks (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| pUrl | Pointer to null-terminated URL string (http:// or https://) DNS lookup will be performed automatically for hostnames |
| headers | Pointer 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) |
| action | Pointer to null-terminated string containing the HTTP method (default: "GET"). Common values: "GET", "POST", "PUT", "DELETE" |
| TIMEOUT_WAIT | Timeout in system ticks for URL parsing, connection establishment, and header transmission (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| TheUri | Reference to ParsedURI object containing the connection and request details (host, port, path, scheme, query parameters) |
| headers | Pointer 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) |
| action | Pointer to null-terminated string containing the HTTP method (default: "GET"). Common values: "GET", "POST", "PUT", "DELETE" |
| TIMEOUT_WAIT | Timeout in system ticks for connection establishment and header transmission (default: 10 seconds). Use TICKS_PER_SECOND for conversion |
| 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.
| prio | Priority |
| url1 | Pointer to a string representing the URL. |
| url2 | Pointer to a second URL. Optional parameter, default is NULL. |
| bDoNtp | Enable the Network Time Protocol (NTP). Optional parameter, default is false. |
| bool StartWebClient | ( | int | prio, |
| const NBString & | url1, | ||
| bool | bDoNtp = false ) |
#include <web_client.h>
Start the web client using a NBString.
| prio | Priority |
| url1 | Reference to a string representing the URL. |
| url2 | Reference to a second URL. Optional parameter, default is NULL. |
| bDoNtp | Enable the Network Time Protocol (NTP). Optional parameter, default is false. |
| 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.
| fd | TCP/TLS file descriptor of an established connection Must be a valid descriptor returned from connection establishment functions |
| uri | Reference to ParsedURI object containing the request details (host, port, path, query parameters for request construction) |
| methodStr | Pointer to null-terminated string containing the HTTP method (e.g., "GET", "POST", "PUT", "DELETE") |
| content_len | Content 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_type | Pointer 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_header | Pointer 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) |