[英]Redirect url with Curl 7.47.1 in C++
I'm using Curl 7.47.1 to download a Redirect url. 我正在使用Curl 7.47.1下载重定向URL。 However, it always returns
但是,它总是返回
CURLE_UNSUPPORTED_PROTOCOL
CURLE_UNSUPPORTED_PROTOCOL
char *url = "http://www.foxitsoftware.com/downloads/latest.php?product=Foxit-Reader&platform=Windows";
CURL * m_curl;
FILE pFile = fopen(outfilename,"wb");
m_curl = curl_easy_init();
curl_easy_setopt(m_curl, CURLOPT_URL, url);
curl_easy_setopt(m_curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(m_curl, CURLOPT_WRITEDATA, pFile);
curl_easy_setopt(m_curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(m_curl, CURLOPT_HEADERFUNCTION, HeaderCallback);
CURLcode res = curl_easy_perform(m_curl);
CURLOPT_VERBOSE
set to 1L to get some additional information. CURLOPT_VERBOSE
设置为1L以获得一些其他信息。 CURLE_UNSUPPORTED_PROTOCOL
means you're asking for a resource/URL over a protocol that your libcurl build doesn't support. CURLE_UNSUPPORTED_PROTOCOL
表示您正在通过libcurl构建不支持的协议请求资源/ URL。 As you're following redirects, that could mean that the first server redirects you over to an non-supported protocol.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.