From: Daniel Stenberg Date: Thu, 23 Oct 2014 12:34:41 +0000 (+0200) Subject: CURLOPT_RESOLVE.3: add an example X-Git-Tag: curl-7_39_0~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e116d0a62;p=thirdparty%2Fcurl.git CURLOPT_RESOLVE.3: add an example --- diff --git a/docs/libcurl/opts/CURLOPT_RESOLVE.3 b/docs/libcurl/opts/CURLOPT_RESOLVE.3 index a1e82bc7a0..06a393a74d 100644 --- a/docs/libcurl/opts/CURLOPT_RESOLVE.3 +++ b/docs/libcurl/opts/CURLOPT_RESOLVE.3 @@ -57,7 +57,23 @@ NULL .SH PROTOCOLS All .SH EXAMPLE -TODO +.nf +CURL *curl; +struct curl_slist *host = NULL; +host = curl_slist_append(NULL, "example.com:80:127.0.0.1"); + +curl = curl_easy_init(); +if(curl) { + curl_easy_setopt(curl, CURLOPT_RESOLVE, host); + curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); + res = curl_easy_perform(curl); + + /* always cleanup */ + curl_easy_cleanup(curl); +} + +curl_slist_free_all(host); +.fi .SH AVAILABILITY Added in 7.21.3 .SH RETURN VALUE