ua_init - create a User-Agent handle#

struct user_agent *ua_init(struct ua_attr *attr)#

Initialize User-Agent handle.

Parameters:
  • attr – optional attributes to override defaults

Returns:

the user agent handle

Example#

struct user_agent *ua = ua_init(NULL);
ua_set_url(ua, "https://www.example.com");

struct ua_conn_attr conn_attr = { .method = HTTP_GET };

ua_easy_run(ua, NULL, NULL, &conn_attr);

ua_cleanup(ua);