Go to the source code of this file.
|
typedef struct http_client_s | http_client_t |
|
typedef struct http_request_s | http_request_t |
|
typedef int64_t | http_req_id_t |
|
|
enum | http_verb_t { http_verb_get = 1
, http_verb_post = 2
, http_verb_put = 3
, http_verb_delete = 4
} |
|
◆ http_client_cancel_request()
void http_client_cancel_request |
( |
http_req_id_t |
req | ) |
|
cancel http request
- Parameters
-
[in] | req | - request to cancel |
◆ http_client_create()
http_client_t* http_client_create |
( |
xroad_xml_tag_t |
cfg | ) |
|
create http client
- Parameters
-
[in] | cfg | - client configuration |
- Returns
- new http client instance, NULL - in case of error
◆ http_client_destroy()
void http_client_destroy |
( |
http_client_t * |
c | ) |
|
destroy http client and free all resources
- Parameters
-
[in] | c | - http client to destroy |
◆ http_client_escape()
escate string with urlencode
- Parameters
-
[in] | str | - string to encode |
- Returns
- url encoded string. must be freed with xroad_str_free
◆ http_client_perform()
perform a http request
- Parameters
-
[in] | c | - http client instance |
[in] | verb | - request type (GET, POST, PUT, DELETE) |
[in] | path | - request URL |
[in] | headers | - options request headers |
[in] | cback | - request callback |
[in] | data | - POST body |
[in] | len | - POST body len |
- Returns
- request id > 0 - successful, < 0 - xroad_errno_t
◆ http_client_reconfig()
xroad_errno_t http_client_reconfig |
( |
http_client_t * |
c, |
|
|
xroad_xml_tag_t |
cfg |
|
) |
| |
reconfig http client
- Parameters
-
[in] | c | - http client to configure |
[in] | cfg | - new configuration instance |
- Returns
- XROAD_OK
◆ http_verb_to_str()
get verb string representation
- Parameters
-
[in] | verb | - verb to convert |
- Returns
- verb string representation