It manages HTTP request.
Required Header
#include <http.h>
Overview
It manages HTTP request message.
- Set/Get URI, method
- Make body for POST/PUT Method It supports other request options according to the HTTP protocol.
Functions |
int | http_transaction_request_set_method (http_transaction_h http_transaction, http_method_e method) |
| Sets an HTTP method of the request header.
|
int | http_transaction_request_get_method (http_transaction_h http_transaction, http_method_e *method) |
| Gets the HTTP method from request header.
|
int | http_transaction_request_set_version (http_transaction_h http_transaction, http_version_e version) |
| Sets an HTTP version of the request header.
|
int | http_transaction_request_get_version (http_transaction_h http_transaction, http_version_e *version) |
| Gets the HTTP version from request header.
|
int | http_transaction_request_set_uri (http_transaction_h http_transaction, const char *host_uri) |
| Sets a URI of the request header.
|
int | http_transaction_request_get_uri (http_transaction_h http_transaction, char **host_uri) |
| Gets the URI.
|
int | http_transaction_request_set_accept_encoding (http_transaction_h http_transaction, const char *encoding) |
| Sets the Accept-Encoding header field of HTTP Request.
|
int | http_transaction_request_get_accept_encoding (http_transaction_h http_transaction, char **encoding) |
| Gets the Accept-Encoding header field of HTTP Request.
|
int | http_transaction_request_set_cookie (http_transaction_h http_transaction, const char *cookie) |
| Sets a cookie in the HTTP request.
|
int | http_transaction_request_get_cookie (http_transaction_h http_transaction, char **cookie) |
| Gets a cookie in the HTTP request.
|
int | http_transaction_request_write_body (http_transaction_h http_transaction, const char *body) |
| Writes the request message body.
|
int | http_transaction_request_set_upload_file (http_transaction_h http_transaction, const char *file_path) |
| Sets the file path for uploading a file.
|
Function Documentation
Gets the Accept-Encoding header field of HTTP Request.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[out] | encoding | The encoding algorithms |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Gets a cookie in the HTTP request.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[out] | cookie | The cookie |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Gets the HTTP method from request header.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[out] | method | The HTTP method |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Gets the URI.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[out] | host_uri | The host URI |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Gets the HTTP version from request header.
Gets the HTTP version.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[out] | version | The HTTP version |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Sets the Accept-Encoding header field of HTTP Request.
The Accept-Encoding header enables automatic decompression of HTTP downloads.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | encoding | The encoding algorithms (e.g. gzip, deflate) |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Sets a cookie in the HTTP request.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | cookie | The cookie |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Sets an HTTP method of the request header.
Sets an HTTP method such as GET, POST, PUT and etc.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | method | The HTTP method |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Sets the file path for uploading a file.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | file_path | The path for file |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Sets a URI of the request header.
Sets a URI of the request header.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | host_uri | The URI to use in the request |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Sets an HTTP version of the request header.
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | version | The HTTP version |
- Returns:
0
on success, otherwise negative error value
- Return values:
-
Writes the request message body.
This function writes the request message body in the internal queue.
The written queue for request body is uploaded after invoking http_transaction_submit().
- Since :
- 3.0
- Parameters:
-
[in] | http_transaction | The HTTP transaction handle |
[in] | body | The message body data |
- Returns:
0
on success, otherwise negative error value
- Return values:
-