HTTP Client#

This module contains the HTTP Client API constants.

Enumerations#

enum
SL_HTTP_GET = 0
SL_HTTP_POST = 1
SL_HTTP_HEAD = 2
SL_HTTP_PUT = 3
SL_HTTP_DELETE = 4
}

Enumeration of HTTP client methods.

enum
SL_TLS_V_1_0 = 0
SL_TLS_V_1_1 = 1
SL_TLS_V_1_2 = 2
SL_TLS_V_1_3 = 3
}

Enumeration of HTTPS client TLS versions.

enum
SL_HTTP_V_1_0 = 0
SL_HTTP_V_1_1 = 1
}

Enumeration of HTTP protocol versions.

enum
SL_HTTP_CLIENT_GET_RESPONSE_EVENT = 0
SL_HTTP_CLIENT_POST_RESPONSE_EVENT
SL_HTTP_CLIENT_PUT_RESPONSE_EVENT
SL_HTTP_CLIENT_MAX_EVENT
}

Enumeration of HTTP client events.

Macros#

#define

Maximum buffer length for write data.

#define

Default certificate index for HTTPS client.

#define

Certificate index for an HTTPS client certificate.

#define

Certificate index for the an HTTPS client certificate.

Enumeration Documentation#

sl_http_client_method_type_t#

sl_http_client_method_type_t

Enumeration of HTTP client methods.

This enumeration defines the HTTP methods that can be used by the HTTP client to perform various operations on the server.

Note

  • Current SDK does not support SL_HTTP_HEAD and SL_HTTP_DELETE methods.

Enumerator
SL_HTTP_GET

HTTP GET method, used to retrieve data from the server.

SL_HTTP_POST

HTTP POST method, used to send data to the server.

SL_HTTP_HEAD

HTTP HEAD method, used to retrieve headers from the server.

SL_HTTP_PUT

HTTP PUT method, used to update or create a resource on the server.

SL_HTTP_DELETE

HTTP DELETE method, used to delete a resource from the server.


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

sl_http_client_tls_version_t#

sl_http_client_tls_version_t

Enumeration of HTTPS client TLS versions.

This enumeration defines the versions of the Transport Layer Security (TLS) protocol that can be used by the HTTPS client. Each version provides different levels of security and compatibility.

Enumerator
SL_TLS_V_1_0

Use TLS Version 1.0 for HTTPS Client.

SL_TLS_V_1_1

Use TLS Version 1.1 for HTTPS Client.

SL_TLS_V_1_2

Use TLS Version 1.2 for HTTPS Client.

SL_TLS_V_1_3

Use TLS Version 1.3 for HTTPS Client.


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

sl_http_client_version_t#

sl_http_client_version_t

Enumeration of HTTP protocol versions.

This enumeration defines the versions of the HTTP protocol that can be used by the HTTP client. Each version corresponds to a specific set of features and behaviors defined by the HTTP standard.

Enumerator
SL_HTTP_V_1_0

Use HTTP Protocol version 1.0.

SL_HTTP_V_1_1

Use HTTP Protocol version 1.1.


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

sl_http_client_event_t#

sl_http_client_event_t

Enumeration of HTTP client events.

This enumeration defines the various events that can occur during HTTP client operations. Each event corresponds to a specific type of HTTP response received by the client.

Enumerator
SL_HTTP_CLIENT_GET_RESPONSE_EVENT

Event for receiving a response to an HTTP GET request.

SL_HTTP_CLIENT_POST_RESPONSE_EVENT

Event for receiving a response to an HTTP POST request.

SL_HTTP_CLIENT_PUT_RESPONSE_EVENT

Event for receiving a response to an HTTP PUT request.

SL_HTTP_CLIENT_MAX_EVENT

Maximum number of HTTP client events.


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

Macro Definition Documentation#

SL_HTTP_CLIENT_MAX_WRITE_BUFFER_LENGTH#

#define SL_HTTP_CLIENT_MAX_WRITE_BUFFER_LENGTH
Value:
900

Maximum buffer length for write data.

This macro defines the maximum length, in bytes, of the buffer used for writing data in HTTP client operations. It ensures that the buffer allocated for outgoing data is sufficiently large to handle typical HTTP requests.


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

SL_HTTPS_CLIENT_DEFAULT_CERTIFICATE_INDEX#

#define SL_HTTPS_CLIENT_DEFAULT_CERTIFICATE_INDEX
Value:
0

Default certificate index for HTTPS client.

This macro defines the default index for the client certificate used in HTTPS connections. It is used to specify which certificate to use from the certificate store when establishing a secure connection.


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

SL_HTTPS_CLIENT_CERTIFICATE_INDEX_1#

#define SL_HTTPS_CLIENT_CERTIFICATE_INDEX_1
Value:
1

Certificate index for an HTTPS client certificate.

This macro defines the index for an HTTPS client certificate used in secure connections. It specifies which certificate to use from the certificate store when establishing a secure connection.


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

SL_HTTPS_CLIENT_CERTIFICATE_INDEX_2#

#define SL_HTTPS_CLIENT_CERTIFICATE_INDEX_2
Value:
2

Certificate index for the an HTTPS client certificate.

This macro defines the index for an HTTPS client certificate used in secure connections. It specifies which certificate to use from the certificate store when establishing a secure connection.


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