mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
CURLOPT_RESOLVE.3: add an example
This commit is contained in:
parent
9f5744a72f
commit
e116d0a625
@ -57,7 +57,23 @@ NULL
|
|||||||
.SH PROTOCOLS
|
.SH PROTOCOLS
|
||||||
All
|
All
|
||||||
.SH EXAMPLE
|
.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
|
.SH AVAILABILITY
|
||||||
Added in 7.21.3
|
Added in 7.21.3
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
|
Loading…
Reference in New Issue
Block a user