summaryrefslogtreecommitdiff
path: root/docs/examples/urlapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/urlapi.c')
-rw-r--r--docs/examples/urlapi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/examples/urlapi.c b/docs/examples/urlapi.c
index 11962abc5..2ed78eb11 100644
--- a/docs/examples/urlapi.c
+++ b/docs/examples/urlapi.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -58,6 +58,9 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_CURLU, urlp);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ /* only allow HTTP, TFTP and SFTP */
+ curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, "http,tftp,sftp");
+
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
@@ -67,7 +70,7 @@ int main(void)
goto cleanup;
}
- cleanup:
+cleanup:
curl_url_cleanup(urlp);
curl_easy_cleanup(curl);
return 0;