libcurl

How do I disable the CURLOPT_HTTPAUTH option in php?

耗尽温柔 提交于 2019-12-11 05:51:56
问题 So this is what I have so far: self::$connection = curl_init(); curl_setopt(self::$connection, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt(self::$connection, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt(self::$connection, CURLOPT_URL, $url); curl_exec(self::$connection); // Do a request that uses Basic Auth curl_setopt(self::$connection, CURLOPT_HTTPAUTH, false); // <-- Not working as expected - I want to disable Basic Auth here curl_setopt(self::$connection, CURLOPT_URL,

Elastic search json range query issue when using libcurl/curl

不问归期 提交于 2019-12-11 05:18:58
问题 I am using libcurl to retrieve my indexed results from elastic search. I have problems with the following code. Meaning, it doesn't return any results. http://pastebin.com/NgdTBTAb I tried its curl variation (below) with no success. curl -XGET http://localhost:9202/_all/_search?pretty=true -d '{ "size": 1000000, "query" : { "range" : { "snapshotTime" : { "from" : "2012-10-31T13:00:00", "to" : "2012-10-31T14:00:00" } } } }' The same code with out "to" in the range query seems to work fine. Its

How do I link dynamically built cmake files on Windows?

怎甘沉沦 提交于 2019-12-11 05:17:09
问题 I have been struggling for the last 8 hours to find information on how to reference a library in a C project on Windows built with CMake, specifically cURL. I have downloaded version 7.67 cURL source from the website, and then went used the visual studio developer command prompt to compile the CMake project into a build folder using the standard method of: cd winbuild nmake /f Makefile.vc mode=dll Which outputs three curl folders, one of them called "libcurl-vc-x86-release-dll-ipv6-sspi

How to build curlpp on Mac OSx 10.8

六眼飞鱼酱① 提交于 2019-12-11 04:58:53
问题 I would like to try the C++ wrapper for libcurl; curlpp. The documentation seems to be non-existent. I am following the steps that I found here: http://wiki.hartungdesign.net/docs:mac:builds:curlpp This basically just says do the typical 1. ./configure (with some args) 2. make 'make' is failing with the following error: Making all in src Making all in utilspp /bin/sh ../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../include/curlpp -I../../include -g -W -Wall

curl does not have same result as browser

独自空忆成欢 提交于 2019-12-11 04:37:23
问题 I am trying to download the following URL using from command line using curl. If the same URL is requested through the browser, it is able to fetch the image. But for curl, the server terminates the SSL handshake. Just to use exact same parameters; I tried the curl commands from 'developer tools' from google-chrome and firefox. But both fails with following error. This question was asked before here here but there is no answer that works. I tried -http1.1 as suggested but did not work. https:

How can I use libcurl function “curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char *address);”

陌路散爱 提交于 2019-12-11 03:31:53
问题 I want to use function curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char *address) , but when I download the source code, ./configure && make && make install every fucntion is OK but this function curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char *address) . This function explanation http://curl.haxx.se/libcurl/c/CURLOPT_DNS_LOCAL_IP4.html.AVAILABILITY says this option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is

libcurl linker error on Xcode5 but working fine on Xcode 4.6

本小妞迷上赌 提交于 2019-12-11 03:18:20
问题 I have a project which uses libcurl.all.a . It builds, links and runs perfectly on Xcode 4.6.3. But in Xcode5, it throws linker errors on undefined symbols. The error log is as follows. Undefined symbols for architecture i386: "_SSLCopyPeerCertificates", referenced from: _darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o) "_SSLDisposeContext", referenced from: _Curl_darwinssl_close in libcurl.all.a(libcurl_la-curl_darwinssl.o) _Curl_darwinssl_shutdown in libcurl.all.a

Libcurl Hostname was NOT found in DNS cache

≡放荡痞女 提交于 2019-12-11 03:15:41
问题 I'm trying 2 parallel connection with curl_multi : CURL *http_handle; CURL *http_handle2; CURLM *multi_handle; int still_running; /* keep number of running handles */ http_handle = curl_easy_init(); http_handle2 = curl_easy_init(); /* set options */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://216.58.208.46"); /* set options */ curl_easy_setopt(http_handle2, CURLOPT_URL, "http://213.180.204.62"); curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L); curl_easy_setopt(http_handle2, CURLOPT

how to use pycurl if requested data is sometimes gzipped, sometimes not?

守給你的承諾、 提交于 2019-12-11 02:52:43
问题 I'm doing this to fetch some data: c = pycurl.Curl() c.setopt(pycurl.ENCODING, 'gzip') c.setopt(pycurl.URL, url) c.setopt(pycurl.TIMEOUT, 10) c.setopt(pycurl.FOLLOWLOCATION, True) xml = StringIO() c.setopt(pycurl.WRITEFUNCTION, xml.write ) c.perform() c.close() My urls are typically of this sort: http://host/path/to/resource-foo.xml Usually I get back 302 pointing to: http://archive-host/path/to/resource-foo.xml.gz Given that I have set FOLLOWLOCATION, and ENCODING gzip, everything works

cURL call with a port in the url/location not working - couldn't connect to host

試著忘記壹切 提交于 2019-12-11 01:25:52
问题 I am trying to make a cURL call to a url that looks like this: https://example.com:9000/test When I execute the following code, I get curl error 7 couldn't connect to host. $headers = array( CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 10, CURLOPT_URL => 'https://example.com:9000/test', ); $headers[CURLOPT_SSL_VERIFYPEER] = FALSE; $headers[CURLOPT_SSL_VERIFYHOST] = 2; $ch = curl_init(); curl_setopt_array($ch, $headers); $response = curl_exec($ch); If I set