diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-10-21 08:58:03 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-10-21 08:58:24 +0200 |
commit | c857bb68ec37f82b62238fca73942e6ede8bd8f7 (patch) | |
tree | 084c1ff2355e2b3ce77c8a69bec4657a78cbfcc2 /docs/libcurl/opts/CURLOPT_URL.3 | |
parent | 005f2adaaa8025849760b30289e06916ea25f548 (diff) |
opts: added examples
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_URL.3')
-rw-r--r-- | docs/libcurl/opts/CURLOPT_URL.3 | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/docs/libcurl/opts/CURLOPT_URL.3 b/docs/libcurl/opts/CURLOPT_URL.3 index 96f5659cc..16b7d523f 100644 --- a/docs/libcurl/opts/CURLOPT_URL.3 +++ b/docs/libcurl/opts/CURLOPT_URL.3 @@ -272,12 +272,23 @@ performed. All .SH EXAMPLE .nf - curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); +CURL *curl = curl_easy_init(); +if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); + + curl_easy_perform(curl); +} +.fi .SH AVAILABILITY -POP3 and SMTP added in 7.31.0 +POP3 and SMTP were added in 7.31.0 .SH RETURN VALUE -Returns CURLE_OK on success or -CURLE_OUT_OF_MEMORY if there was insufficient heap space. +Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient +heap space. + +Note that \fIcurl_easy_setopt(3)\fP won't actually parse the given string so +given a bad URL, it will not be detected until \fIcurl_easy_perform(3)\fP or +similar is called. .SH "SEE ALSO" .BR CURLOPT_VERBOSE "(3), " CURLOPT_PROTOCOLS "(3), " +.BR CURLOPT_FORBID_REUSE "(3), " CURLOPT_FRESH_CONNECT "(3), " .BR curl_easy_perform "(3)" |