HTTP client request configurations.

This structure holds the configuration settings for an HTTP client request, that includes the HTTP method, server address, resource URL, headers, and other options.

Configuration settings for an HTTP client request.

This structure contains all the necessary configuration parameters for making an HTTP client request, which includes the HTTP method, server address, resource URL, headers, and other options.

Public Attributes#

uint8_t *

IP address should contain the IP address of the HTTP server as a string (values in ASCII), for example, "192.168.1.1" for IPv4 or "2001:0db8:85a3:0000:0000:8a2e:0370:7334" for IPv6.

uint8_t *

Full URL string for the requested resource, including the scheme (for example, http, https), domain, port, path, query parameters, and fragment. The maximum supported HTTP URL is 2048 bytes when the SL_SI91X_FEAT_LONG_HTTP_URL bit is enabled in the feature_bit_map. If the SL_SI91X_FEAT_LONG_HTTP_URL bit is disabled, then the maximum supported length for the HTTP URL is (872 - (length of username + length of password) - length of hostname - length of IP address) bytes, excludes the delimiters.

uint16_t

Port number of the HTTP server.

si91x_socket_type_length_value_t *

SNI (Server Name Indication) extension to specify the hostname for servers hosting multiple domains on the same IP address of type si91x_socket_type_length_value_t.

uint8_t *

HTTP body to be sent to the server. Setting this to NULL will process the request in chunked encoding.

uint32_t

Length of the HTTP body data to be posted. In the case of a chunked request, body length should be equal to the total content length.

User-defined extended header. If NULL, the default extended header will be added internally. See sl_http_client_header_t.

uint16_t

HTTP request timeout period in milliseconds. (Si91x chipsets do not support this feature).

uint16_t

Maximum number of retry attempts after a timeout. (Si91x chipsets do not support this feature).

uint16_t

Retry period in milliseconds after the maximum retry count is reached. (Si91x chipsets do not support this feature).

bool

Flag to indicate whether to reuse the same TCP socket for the connection. (Si91x chipsets do not support this feature).

void *

User-defined context for the request.

Callback function for handling HTTP client events. See sl_http_client_event_handler_t.

uint8_t *

Hostname of the HTTP server as specified in the request header. If NULL, the ip_address is used instead of the hostname.

Public Attribute Documentation#

http_method_type#

sl_http_client_method_type_t sl_http_client_request_t::http_method_type

HTTP request method. See sl_http_client_method_type_t.


Definition at line 247 of file components/service/http_client/inc/sl_http_client.h

ip_address#

uint8_t* sl_http_client_request_t::ip_address

IP address should contain the IP address of the HTTP server as a string (values in ASCII), for example, "192.168.1.1" for IPv4 or "2001:0db8:85a3:0000:0000:8a2e:0370:7334" for IPv6.


Definition at line 249 of file components/service/http_client/inc/sl_http_client.h

resource#

uint8_t* sl_http_client_request_t::resource

Full URL string for the requested resource, including the scheme (for example, http, https), domain, port, path, query parameters, and fragment. The maximum supported HTTP URL is 2048 bytes when the SL_SI91X_FEAT_LONG_HTTP_URL bit is enabled in the feature_bit_map. If the SL_SI91X_FEAT_LONG_HTTP_URL bit is disabled, then the maximum supported length for the HTTP URL is (872 - (length of username + length of password) - length of hostname - length of IP address) bytes, excludes the delimiters.


Definition at line 251 of file components/service/http_client/inc/sl_http_client.h

port#

uint16_t sl_http_client_request_t::port

Port number of the HTTP server.


Definition at line 252 of file components/service/http_client/inc/sl_http_client.h

sni_extension#

si91x_socket_type_length_value_t* sl_http_client_request_t::sni_extension

SNI (Server Name Indication) extension to specify the hostname for servers hosting multiple domains on the same IP address of type si91x_socket_type_length_value_t.


Definition at line 254 of file components/service/http_client/inc/sl_http_client.h

body#

uint8_t* sl_http_client_request_t::body

HTTP body to be sent to the server. Setting this to NULL will process the request in chunked encoding.


Definition at line 256 of file components/service/http_client/inc/sl_http_client.h

body_length#

uint32_t sl_http_client_request_t::body_length

Length of the HTTP body data to be posted. In the case of a chunked request, body length should be equal to the total content length.


Definition at line 258 of file components/service/http_client/inc/sl_http_client.h

extended_header#

sl_http_client_header_t* sl_http_client_request_t::extended_header

User-defined extended header. If NULL, the default extended header will be added internally. See sl_http_client_header_t.


Definition at line 260 of file components/service/http_client/inc/sl_http_client.h

timeout_ms#

uint16_t sl_http_client_request_t::timeout_ms

HTTP request timeout period in milliseconds. (Si91x chipsets do not support this feature).


Definition at line 261 of file components/service/http_client/inc/sl_http_client.h

retry_count#

uint16_t sl_http_client_request_t::retry_count

Maximum number of retry attempts after a timeout. (Si91x chipsets do not support this feature).


Definition at line 263 of file components/service/http_client/inc/sl_http_client.h

retry_period_ms#

uint16_t sl_http_client_request_t::retry_period_ms

Retry period in milliseconds after the maximum retry count is reached. (Si91x chipsets do not support this feature).


Definition at line 265 of file components/service/http_client/inc/sl_http_client.h

tcp_connection_reuse#

bool sl_http_client_request_t::tcp_connection_reuse

Flag to indicate whether to reuse the same TCP socket for the connection. (Si91x chipsets do not support this feature).


Definition at line 267 of file components/service/http_client/inc/sl_http_client.h

context#

void* sl_http_client_request_t::context

User-defined context for the request.


Definition at line 268 of file components/service/http_client/inc/sl_http_client.h

event_handler#

sl_http_client_event_handler_t sl_http_client_request_t::event_handler

Callback function for handling HTTP client events. See sl_http_client_event_handler_t.


Definition at line 270 of file components/service/http_client/inc/sl_http_client.h

host_name#

uint8_t* sl_http_client_request_t::host_name

Hostname of the HTTP server as specified in the request header. If NULL, the ip_address is used instead of the hostname.


Definition at line 272 of file components/service/http_client/inc/sl_http_client.h