ua_conn_setup - set transfer attributes#
-
void ua_conn_setup(struct ua_conn *conn, struct ua_conn_attr *attr)#
Setup transfer attributes.
- Parameters:
conn – the connection handle
attr – attributes to be set for transfer
Example#
struct user_agent *ua = ua_init(NULL);
ua_set_url(ua, "https://www.example.com");
struct sized_buffer body = { "hi", 2 };
struct ua_conn_attr conn_attr = { .method = HTTP_POST,
.body = &body,
.endpoint = "/echo?m=POST" };
struct ua_conn *conn = ua_conn_start(ua);
ua_conn_setup(conn, &conn_attr);
ua_conn_easy_perform(conn);
ua_conn_stop(conn);
ua_cleanup(ua);