|
Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
HTTP client API. More...
Data Structures | |
| struct | http_response |
| struct | http_client_internal_data |
| struct | http_request |
Macros | |
| #define | HTTP_CRLF "\r\n" |
| #define | HTTP_STATUS_STR_SIZE 32 |
Typedefs | |
| typedef int(* | http_payload_cb_t) (int sock, struct http_request *req, void *user_data) |
| Callback used when data needs to be sent to the server. More... | |
| typedef int(* | http_header_cb_t) (int sock, struct http_request *req, void *user_data) |
| Callback can be used if application wants to construct additional HTTP headers when the HTTP request is sent. Usage of this is optional. More... | |
| typedef void(* | http_response_cb_t) (struct http_response *rsp, enum http_final_call final_data, void *user_data) |
| Callback used when data is received from the server. More... | |
Enumerations | |
| enum | http_final_call { HTTP_DATA_MORE = 0 , HTTP_DATA_FINAL = 1 } |
Functions | |
| int | http_client_req (int sock, struct http_request *req, int32_t timeout, void *user_data) |
| Do a HTTP request. The callback is called when data is received from the HTTP server. The caller must have created a connection to the server before calling this function so connect() call must have be done successfully for the socket. More... | |
HTTP client API.
| #define HTTP_CRLF "\r\n" |
#include <include/net/http_client.h>
| #define HTTP_STATUS_STR_SIZE 32 |
#include <include/net/http_client.h>
| http_header_cb_t |
#include <include/net/http_client.h>
Callback can be used if application wants to construct additional HTTP headers when the HTTP request is sent. Usage of this is optional.
| sock | Socket id of the connection |
| req | HTTP request information |
| user_data | User specified data specified in http_client_req() |
| http_payload_cb_t |
#include <include/net/http_client.h>
Callback used when data needs to be sent to the server.
| sock | Socket id of the connection |
| req | HTTP request information |
| user_data | User specified data specified in http_client_req() |
| http_response_cb_t |
#include <include/net/http_client.h>
Callback used when data is received from the server.
| rsp | HTTP response information |
| final_data | Does this data buffer contain all the data or is there still more data to come. |
| user_data | User specified data specified in http_client_req() |
| enum http_final_call |
#include <include/net/http_client.h>
| Enumerator | |
|---|---|
| HTTP_DATA_MORE | |
| HTTP_DATA_FINAL | |
| int http_client_req | ( | int | sock, |
| struct http_request * | req, | ||
| int32_t | timeout, | ||
| void * | user_data | ||
| ) |
#include <include/net/http_client.h>
Do a HTTP request. The callback is called when data is received from the HTTP server. The caller must have created a connection to the server before calling this function so connect() call must have be done successfully for the socket.
| sock | Socket id of the connection. |
| req | HTTP request information |
| timeout | Max timeout to wait for the data. The timeout value cannot be 0 as there would be no time to receive the data. The timeout value is in milliseconds. |
| user_data | User specified data that is passed to the callback. |