Filter results by

Older Versions

Older API versions are available as a download. To view, extract the file and open the index.html file in a web browser.

artik_http_module Struct Reference

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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[out]responsePointer 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]statusPointer to the status filled up by the function with the server's response status
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]callbackFunction called upon receiving response returned by the server
[in]user_dataPointer to user data that will be passed as a parameter to the callback function
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[out]responsePointer 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]statusPointer to the status filled up by the function with the server's response status
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]callbackFunction called upon receiving response returned by the server
[in]user_dataPointer to user data that will be passed as a parameter to the callback function
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[out]statusPointer to the status filled up by the function with the server's response status
[in]callbackFunction called upon receiving new data from the stream
[in]user_dataPointer to user data that will be passed as a parameter to the callback function
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]stream_callbackFunction called upon receiving new data from the stream
[in]response_callbackFunction called upon receiving response returned by the server
[in]user_dataPointer to user data that will be passed as a parameter to the callbacks functions
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]bodyString containing the body data to send along the POST request
[out]responsePointer 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]statusPointer to the status filled up by the function with the server's response status
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]bodyString containing the body data to send along the POST request
[in]callbackFunction called upon receiving response returned by the server
[in]user_dataPointer to user data that will be passed as a parameter to the callback function
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]bodyString containing the body data to send along the PUT request
[out]responsePointer 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]statusPointer to the status filled up by the function with the server's response status
[in]sslSSL 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]urlURL to request
[in]headersPointer to the structure object containing the HTTP headers to send
[in]bodyString containing the body data to send along the PUT request
[in]callbackFunction called upon receiving response returned by the server
[in]user_dataPointer to user data that will be passed as a parameter to the callback function
[in]sslSSL 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:
Last updated on: