HTTP module operations. More...
#include <connectivity/artik_http.h>
Data Fields | |
| artik_error(* | get_stream )(const char *url, artik_http_headers *headers, int *status, artik_http_stream_callback callback, void *user_data, artik_ssl_config *ssl) |
| Perform a GET request on streaming data. More... | |
| artik_error(* | get_stream_async )(const char *url, artik_http_headers *headers, artik_http_stream_callback stream_callback, artik_http_response_callback response_callback, void *user_data, artik_ssl_config *ssl) |
| Perform a GET request on streaming data asynchronously. More... | |
| artik_error(* | get )(const char *url, artik_http_headers *headers, char **response, int *status, artik_ssl_config *ssl) |
| Perform a GET request. More... | |
| artik_error(* | get_async )(const char *url, artik_http_headers *headers, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
| Perform a GET request asynchronously. More... | |
| artik_error(* | post )(const char *url, artik_http_headers *headers, const char *body, char **response, int *status, artik_ssl_config *ssl) |
| Perform a POST request. More... | |
| artik_error(* | post_async )(const char *url, artik_http_headers *headers, const char *body, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
| Perform a POST request asynchronously. More... | |
| artik_error(* | put )(const char *url, artik_http_headers *headers, const char *body, char **response, int *status, artik_ssl_config *ssl) |
| Perform a PUT request. More... | |
| artik_error(* | put_async )(const char *url, artik_http_headers *headers, const char *body, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
| Perform a PUT request asynchronously. More... | |
| artik_error(* | del )(const char *url, artik_http_headers *headers, char **response, int *status, artik_ssl_config *ssl) |
| Perform a DELETE request. More... | |
| artik_error(* | del_async )(const char *url, artik_http_headers *headers, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
| Perform a DELETE request asynchronously. More... | |
Detailed Description
Structure containing all the operations exposed by the module to perform HTTP requests
- Examples:
- http_test/artik_http_openssl_test.c, and http_test/artik_http_test.c.
Definition at line 119 of file artik_http.h.
Field Documentation
| artik_error(* artik_http_module::del) (const char *url, artik_http_headers *headers, char **response, int *status, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [out] response Pointer to a string allocated and filled up by the function with the response body returned by the server. It should be freed by the calling function after use. [out] status Pointer to the status filled up by the function with the server's response status [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 327 of file artik_http.h.
| artik_error(* artik_http_module::del_async) (const char *url, artik_http_headers *headers, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] callback Function called upon receiving response returned by the server [in] user_data Pointer to user data that will be passed as a parameter to the callback function [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 346 of file artik_http.h.
| artik_error(* artik_http_module::get) (const char *url, artik_http_headers *headers, char **response, int *status, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [out] response Pointer to a string allocated and filled up by the function with the response body returned by the server. It should be freed by the calling function after use. [out] status Pointer to the status filled up by the function with the server's response status [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_openssl_test.c, and http_test/artik_http_test.c.
Definition at line 188 of file artik_http.h.
| artik_error(* artik_http_module::get_async) (const char *url, artik_http_headers *headers, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] callback Function called upon receiving response returned by the server [in] user_data Pointer to user data that will be passed as a parameter to the callback function [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 207 of file artik_http.h.
| artik_error(* artik_http_module::get_stream) (const char *url, artik_http_headers *headers, int *status, artik_http_stream_callback callback, void *user_data, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [out] status Pointer to the status filled up by the function with the server's response status [in] callback Function called upon receiving new data from the stream [in] user_data Pointer to user data that will be passed as a parameter to the callback function [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 139 of file artik_http.h.
| artik_error(* artik_http_module::get_stream_async) (const char *url, artik_http_headers *headers, artik_http_stream_callback stream_callback, artik_http_response_callback response_callback, void *user_data, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] stream_callback Function called upon receiving new data from the stream [in] response_callback Function called upon receiving response returned by the server [in] user_data Pointer to user data that will be passed as a parameter to the callbacks functions [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 163 of file artik_http.h.
| artik_error(* artik_http_module::post) (const char *url, artik_http_headers *headers, const char *body, char **response, int *status, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] body String containing the body data to send along the POST request [out] response Pointer to a string allocated and filled up by the function with the response body returned by the server. It should be freed by the calling function after use. [out] status Pointer to the status filled up by the function with the server's response status [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 233 of file artik_http.h.
| artik_error(* artik_http_module::post_async) (const char *url, artik_http_headers *headers, const char *body, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] body String containing the body data to send along the POST request [in] callback Function called upon receiving response returned by the server [in] user_data Pointer to user data that will be passed as a parameter to the callback function [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 254 of file artik_http.h.
| artik_error(* artik_http_module::put) (const char *url, artik_http_headers *headers, const char *body, char **response, int *status, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] body String containing the body data to send along the PUT request [out] response Pointer to a string allocated and filled up by the function with the response body returned by the server. It should be freed by the calling function after use. [out] status Pointer to the status filled up by the function with the server's response status [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 281 of file artik_http.h.
| artik_error(* artik_http_module::put_async) (const char *url, artik_http_headers *headers, const char *body, artik_http_response_callback callback, void *user_data, artik_ssl_config *ssl) |
- Parameters
-
[in] url URL to request [in] headers Pointer to the structure object containing the HTTP headers to send [in] body String containing the body data to send along the PUT request [in] callback Function called upon receiving response returned by the server [in] user_data Pointer to user data that will be passed as a parameter to the callback function [in] ssl SSL configuration to use when targeting https urls. Can be NULL.
- Returns
- S_OK on success, error code otherwise
- Examples:
- http_test/artik_http_test.c.
Definition at line 302 of file artik_http.h.
The documentation for this struct was generated from the following file:
- inc/connectivity/artik_http.h