Tizen Native API
5.0
|
The HTTP API provides functions for communication with server according to the HTTP protocol.
#include <http.h>
The HTTP API provides functions for communication with server according to the HTTP protocol. Using the HTTP APIs, you can implement features that allow the users of your application to:
Functions | |
int | http_init (void) |
Initializes the HTTP module. | |
int | http_deinit (void) |
Deinitializes the HTTP module. | |
Typedefs | |
typedef void * | http_session_h |
The HTTP Session handle. | |
typedef void * | http_transaction_h |
The HTTP Transaction handle. | |
typedef void(* | http_transaction_header_cb )(http_transaction_h http_transaction, char *header, size_t header_len, void *user_data) |
Called when the HTTP header is received. | |
typedef void(* | http_transaction_body_cb )(http_transaction_h http_transaction, char *body, size_t size, size_t count, void *user_data) |
Called when the HTTP response is received. | |
typedef void(* | http_transaction_write_cb )(http_transaction_h http_transaction, int recommended_chunk_size, void *user_data) |
Called when the HTTP ready to write event is received. | |
typedef void(* | http_transaction_completed_cb )(http_transaction_h http_transaction, void *user_data) |
Called when the HTTP transaction is completed. | |
typedef void(* | http_transaction_aborted_cb )(http_transaction_h http_transaction, http_error_code_e error, void *user_data) |
Called when the HTTP transaction is aborted. | |
typedef void(* | http_transaction_progress_cb )(http_transaction_h http_transaction, double download_total, double download_now, double upload_total, double upload_now, void *user_data) |
Called to notify when the content body of the response message is being downloaded or uploaded. |
typedef void* http_session_h |
The HTTP Session handle.
typedef void(* http_transaction_aborted_cb)(http_transaction_h http_transaction, http_error_code_e error, void *user_data) |
Called when the HTTP transaction is aborted.
Following error codes can be delivered.
HTTP_ERROR_OPERATION_FAILED,
HTTP_ERROR_COULDNT_RESOLVE_HOST,
HTTP_ERROR_COULDNT_CONNECT,
HTTP_ERROR_OPERATION_TIMEDOUT,
HTTP_ERROR_SSL_CONNECT_ERROR.
[in] | http_transaction | The HTTP transaction handle |
[in] | error | The error code about aborted reason |
[in] | user_data | The user data |
typedef void(* http_transaction_body_cb)(http_transaction_h http_transaction, char *body, size_t size, size_t count, void *user_data) |
Called when the HTTP response is received.
[in] | http_transaction | The HTTP transaction handle |
[in] | body | Response information of HTTP Transaction |
[in] | size | Size in bytes of each element to be written |
[in] | count | Number of elements, each one with a size of size bytes |
[in] | user_data | The user data |
typedef void(* http_transaction_completed_cb)(http_transaction_h http_transaction, void *user_data) |
Called when the HTTP transaction is completed.
[in] | http_transaction | The HTTP transaction handle |
[in] | user_data | The user data |
typedef void* http_transaction_h |
The HTTP Transaction handle.
typedef void(* http_transaction_header_cb)(http_transaction_h http_transaction, char *header, size_t header_len, void *user_data) |
Called when the HTTP header is received.
[in] | http_transaction | The HTTP transaction handle |
[in] | header | The header information of HTTP Transaction |
[in] | header_len | The length of the HTTP Transaction header |
[in] | user_data | The user data |
typedef void(* http_transaction_progress_cb)(http_transaction_h http_transaction, double download_total, double download_now, double upload_total, double upload_now, void *user_data) |
Called to notify when the content body of the response message is being downloaded or uploaded.
[in] | http_transaction | The HTTP transaction handle |
[in] | download_total | The total length of the data (in bytes) to download |
[in] | download_now | The current length of the downloaded data (in bytes) |
[in] | upload_total | The total length of the data (in bytes) to upload |
[in] | upload_now | The current length of the uploaded data (in bytes) |
[in] | user_data | The user data |
typedef void(* http_transaction_write_cb)(http_transaction_h http_transaction, int recommended_chunk_size, void *user_data) |
Called when the HTTP ready to write event is received.
[in] | http_transaction | The HTTP transaction handle |
[in] | recommended_chunk_size | Recommended chunk length(bytes) of the HTTP transaction |
[in] | user_data | The user data |
enum http_auth_scheme_e |
Enumeration for the HTTP authentication schemes.
enum http_error_code_e |
Enumeration for the HTTP error code.
enum http_method_e |
Enumeration for the HTTP method.
enum http_pause_type_e |
enum http_status_code_e |
Enumeration for the HTTP status code.
enum http_version_e |
int http_deinit | ( | void | ) |
Deinitializes the HTTP module.
0
on success, otherwise negative error value HTTP_ERROR_NONE | Successful |
HTTP_ERROR_OPERATION_FAILED | Operation failed |
HTTP_ERROR_NOT_SUPPORTED | Not Supported |
int http_init | ( | void | ) |
Initializes the HTTP module.
0
on success, otherwise negative error value HTTP_ERROR_NONE | Successful |
HTTP_ERROR_OPERATION_FAILED | Operation failed |
HTTP_ERROR_NOT_SUPPORTED | Not Supported |