man pages: switch to https://example.com URLs
Since HTTPS is "the new normal", this update changes a lot of man page examples to use https://example.com instead of the previous "http://..." Closes #5969
This commit is contained in:
Родитель
cd048aaa28
Коммит
83cc966708
|
@ -5,7 +5,7 @@
|
|||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2020, 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
|
||||
|
@ -60,7 +60,7 @@ None
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ other curl functions.
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ the error buffer when non-zero is returned.
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
|
|
@ -655,7 +655,7 @@ the option was disabled at compile-time, it will return
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2020, 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
|
||||
|
@ -56,7 +56,7 @@ A mime struct handle, or NULL upon failure.
|
|||
|
||||
/* Post and send it. */
|
||||
curl_easy_setopt(easy, CURLOPT_MIMEPOST, mime);
|
||||
curl_easy_setopt(easy, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(easy, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_perform(easy);
|
||||
|
||||
/* Clean-up. */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 2018 - 2020, 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
|
||||
|
@ -30,7 +30,7 @@ supports a set of additional environment variables independently of this.
|
|||
.IP "[scheme]_proxy"
|
||||
When libcurl is given a URL to use in a transfer, it first extracts the
|
||||
"scheme" part from the URL and checks if there is a given proxy set for that
|
||||
in its corresponding environment variable. A URL like "http://example.com"
|
||||
in its corresponding environment variable. A URL like "https://example.com"
|
||||
will hence use the "http_proxy" variable, while a URL like "ftp://example.com"
|
||||
will use the "ftp_proxy" variable.
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ behind a firewall. Applications can mitigate against this by using the
|
|||
\fICURLOPT_FTP_SKIP_PASV_IP(3)\fP option or \fICURLOPT_FTPPORT(3)\fP.
|
||||
|
||||
Local servers sometimes assume local access comes from friends and trusted
|
||||
users. An application that expects http://example.com/file_to_read that and
|
||||
users. An application that expects https://example.com/file_to_read that and
|
||||
instead gets http://192.168.0.1/my_router_config might print a file that would
|
||||
otherwise be protected by the firewall.
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_socket_t sockfd;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Do not do the transfer - only connect to host */
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||
|
|
|
@ -41,7 +41,7 @@ HTTP and some
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* January 1, 2020 is 1577833200 */
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
|
||||
|
|
|
@ -41,7 +41,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -38,7 +38,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -40,7 +40,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the upload */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -37,7 +37,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the upload */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -42,7 +42,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* enable the cookie engine */
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "");
|
||||
|
|
|
@ -47,7 +47,7 @@ HTTP(S)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "data");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -43,7 +43,7 @@ HTTP(S)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
|
|
|
@ -40,7 +40,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long size;
|
||||
|
|
|
@ -38,7 +38,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ HTTP
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long http_version;
|
||||
|
|
|
@ -47,7 +47,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
long sockfd; /* doesn't work on win64! */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Do not do the transfer - only connect to host */
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||
|
|
|
@ -45,7 +45,7 @@ All
|
|||
{
|
||||
char *ip;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -40,7 +40,7 @@ All
|
|||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
|
|
|
@ -41,7 +41,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
|
|
|
@ -38,7 +38,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
long error;
|
||||
|
|
|
@ -44,7 +44,7 @@ All network based ones
|
|||
{
|
||||
char *ip;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -37,7 +37,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long port;
|
||||
|
|
|
@ -39,7 +39,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
void *pointer = 0x2345454;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* set the private pointer */
|
||||
curl_easy_setopt(curl, CURLOPT_PRIVATE, pointer);
|
||||
|
|
|
@ -46,7 +46,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long protocol;
|
||||
|
|
|
@ -38,7 +38,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1:80");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -37,7 +37,7 @@ HTTP(S)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
|
|
|
@ -43,7 +43,7 @@ HTTP(S)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *url = NULL;
|
||||
|
|
|
@ -38,7 +38,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long req;
|
||||
|
|
|
@ -42,7 +42,7 @@ HTTP, FTP and SMTP
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long response_code;
|
||||
|
|
|
@ -44,7 +44,7 @@ HTTP(S)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
curl_off_t wait = 0;
|
||||
|
|
|
@ -42,7 +42,7 @@ All
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *scheme = NULL;
|
||||
|
|
|
@ -42,7 +42,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -39,7 +39,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -39,7 +39,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -36,7 +36,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -38,7 +38,7 @@ sensible variable type.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -35,7 +35,7 @@ that curl measured for the complete download. Measured in bytes/second.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -38,7 +38,7 @@ sensible variable type.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -35,7 +35,7 @@ curl measured for the complete upload. Measured in bytes/second.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
@ -82,7 +82,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* enable all supported built-in compressions */
|
||||
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
|
||||
|
|
|
@ -39,7 +39,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* follow redirects */
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
|
|
@ -47,7 +47,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* complete connection within 10 seconds */
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10L);
|
||||
|
|
|
@ -47,7 +47,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* complete connection within 10000 milliseconds */
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, 10000L);
|
||||
|
|
|
@ -93,7 +93,7 @@ connect_to = curl_slist_append(NULL, "example.com::server1.example.com:");
|
|||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECT_TO, connect_to);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
curl_easy_perform(curl);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIE, "tool=curl; fun=yes;");
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* get cookies from an existing file */
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "/tmp/cookies.txt");
|
||||
|
|
|
@ -57,7 +57,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* export cookies to this file when closing the handle */
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "/tmp/cookies.txt");
|
||||
|
|
|
@ -45,7 +45,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* new "session", don't load session cookies */
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIESESSION, 1L);
|
||||
|
|
|
@ -50,7 +50,7 @@ HTTP(S)
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
char local_buffer[1024]="data to send";
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* size of the data to copy from the buffer and send in the request */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 12L);
|
||||
|
|
|
@ -50,7 +50,7 @@ CURLU *urlp = curl_url();
|
|||
int res = 0;
|
||||
if(curl) {
|
||||
|
||||
res = curl_url_set(urlp, CURLUPART_URL, "http://example.com", 0);
|
||||
res = curl_url_set(urlp, CURLUPART_URL, "https://example.com", 0);
|
||||
|
||||
curl_easy_setopt(handle, CURLOPT_CURLU, urlp);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ HTTP, FTP, IMAP, POP3 and SMTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* DELETE the given path */
|
||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||
|
|
|
@ -166,7 +166,7 @@ int main(void)
|
|||
/* example.com is redirected, so we tell libcurl to follow redirection */
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
/* Check for errors */
|
||||
if(res != CURLE_OK)
|
||||
|
|
|
@ -39,7 +39,7 @@ Several
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L);
|
||||
|
||||
curl_easy_perform(curl);
|
||||
|
|
|
@ -50,7 +50,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* only reuse addresses for a very short time */
|
||||
curl_easy_setopt(curl, CURLOPT_DNS_CACHE_TIMEOUT, 2L);
|
||||
|
|
|
@ -42,7 +42,7 @@ NULL
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_DNS_INTERFACE, "eth0");
|
||||
ret = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
|
|
|
@ -43,7 +43,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP4, "192.168.0.14");
|
||||
ret = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
|
|
|
@ -43,7 +43,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP6, "fe80::a9ff:fe46:b619");
|
||||
ret = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
|
|
|
@ -47,7 +47,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_DNS_SERVERS, "192.168.1.100:53,192.168.1.101");
|
||||
ret = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
|
|
|
@ -53,7 +53,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_DOH_URL, "https://dns.example.com");
|
||||
curl_easy_perform(curl);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ if(curl) {
|
|||
CURLcode res;
|
||||
char errbuf[CURL_ERROR_SIZE];
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* provide a buffer to store errors in */
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
|
||||
|
|
|
@ -43,7 +43,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* wait 3 seconds for 100-continue */
|
||||
curl_easy_setopt(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, 3000L);
|
||||
|
|
|
@ -63,7 +63,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* example.com is redirected, so we tell libcurl to follow redirection */
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
|
|
@ -55,7 +55,7 @@ Most
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ static size_t header_callback(char *buffer, size_t size,
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
struct my_info my = { 10, "the cookies are in the cupboard" };
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback);
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ static size_t header_callback(char *buffer, size_t size,
|
|||
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ HTTP
|
|||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
struct curl_slist *list;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
list = curl_slist_append(NULL, "ICY 200 OK");
|
||||
list = curl_slist_append(list, "WEIRDO 99 FINE");
|
||||
|
|
|
@ -46,7 +46,7 @@ HTTP(S)
|
|||
.nf
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* use a GET to fetch this */
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
|
||||
|
|
|
@ -102,7 +102,7 @@ CURL *curl = curl_easy_init();
|
|||
struct curl_slist *list = NULL;
|
||||
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
list = curl_slist_append(list, "Shoesize: 10");
|
||||
list = curl_slist_append(list, "Accept:");
|
||||
|
|
|
@ -51,7 +51,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* we know the server is silly, ignore content-length */
|
||||
curl_easy_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, 1L);
|
||||
|
|
|
@ -54,7 +54,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_INTERFACE, "eth0");
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* resolve host name using IPv6-names only */
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
|
||||
|
|
|
@ -43,7 +43,7 @@ All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
|
||||
curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
|
||||
curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "superman");
|
||||
|
|
|
@ -40,7 +40,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_LOCALPORT, 49152L);
|
||||
/* and try 20 more ports following that */
|
||||
curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, 20L);
|
||||
|
|
|
@ -44,7 +44,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_LOCALPORT, 49152L);
|
||||
/* and try 20 more ports following that */
|
||||
curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, 20L);
|
||||
|
|
|
@ -48,7 +48,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* only allow 30 seconds idle time */
|
||||
curl_easy_setopt(curl, CURLOPT_MAXAGE_CONN, 30L);
|
||||
|
|
|
@ -44,7 +44,7 @@ HTTP(S)
|
|||
.nf
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
|
||||
/* enable redirect following */
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
|
|
@ -40,7 +40,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* enable progress meter */
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
|
|
|
@ -44,7 +44,7 @@ Most
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_PASSWORD, "qwerty");
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/../../etc/password");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/../../etc/password");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_PATH_AS_IS, 1L);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ Used for all protocols that speak to a port number.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_PORT, 8080L);
|
||||
ret = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
|
|
|
@ -72,7 +72,7 @@ HTTP
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_POST, 1L);
|
||||
|
||||
/* set up the read callback with CURLOPT_READFUNCTION */
|
||||
|
|
|
@ -69,7 +69,7 @@ CURL *curl = curl_easy_init();
|
|||
if(curl) {
|
||||
const char *data = "data to send";
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* size of the POST data */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 12L);
|
||||
|
|
|
@ -44,7 +44,7 @@ CURL *curl = curl_easy_init();
|
|||
if(curl) {
|
||||
const char *data = "data to send";
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* size of the POST data */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(data));
|
||||
|
|
|
@ -45,7 +45,7 @@ if(curl) {
|
|||
const char *data = large_chunk;
|
||||
curl_off_t length_of_data; /* set somehow */
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* size of the POST data */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, length_of_data);
|
||||
|
|
|
@ -52,7 +52,7 @@ HTTP(S)
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* a silly POST example */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "data=true");
|
||||
|
|
|
@ -64,7 +64,7 @@ All except file://. Note that some protocols don't do very well over proxy.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/file.txt");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/file.txt");
|
||||
curl_easy_setopt(curl, CURLOPT_PREPROXY, "socks4://socks-proxy:1080");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80");
|
||||
curl_easy_perform(curl);
|
||||
|
|
|
@ -42,7 +42,7 @@ CURL *curl = curl_easy_init();
|
|||
struct private secrets;
|
||||
if(curl) {
|
||||
struct private *extracted;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* store a pointer to our private struct */
|
||||
curl_easy_setopt(curl, CURLOPT_PRIVATE, &secrets);
|
||||
|
|
|
@ -95,7 +95,7 @@ All except file://. Note that some protocols don't do very well over proxy.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/file.txt");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/file.txt");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80");
|
||||
curl_easy_perform(curl);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ Most
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
|
||||
|
|
|
@ -42,7 +42,7 @@ All
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080L);
|
||||
ret = curl_easy_perform(curl);
|
||||
|
|
|
@ -48,7 +48,7 @@ Most
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
|
||||
|
|
|
@ -46,7 +46,7 @@ Used with all protocols that can use a proxy
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "clark%20kent:superman");
|
||||
ret = curl_easy_perform(curl);
|
||||
|
|
|
@ -45,7 +45,7 @@ Used with HTTPS proxy
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "superman");
|
||||
ret = curl_easy_perform(curl);
|
||||
|
|
|
@ -63,7 +63,7 @@ HTTP, FTP, FILE, RTSP and SFTP.
|
|||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* get the first 200 bytes */
|
||||
curl_easy_setopt(curl, CURLOPT_RANGE, "0-199");
|
||||
|
|
|
@ -47,7 +47,7 @@ This is used for all protocols when sending data.
|
|||
CURL *curl = curl_easy_init();
|
||||
struct MyData this;
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* pass pointer that gets passed in to the
|
||||
CURLOPT_READFUNCTION callback */
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче