libcurl

Curl in php returns 404 response code even if url is working

和自甴很熟 提交于 2019-12-24 05:47:12
问题 I am using php 5.4 in CentOs 6.5 I am trying to get response code of a url below is my code snippet $URL="http://www.bertuccis.com/#menu"; try{ $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_USERAGENT,'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36'); curl_setopt($c, CURLOPT_URL, $URL);

error 411 Length Required c++, libcurl PUT request

无人久伴 提交于 2019-12-24 05:39:08
问题 Even though I set in header Content-Lenght I'm getting 411 error. I'm trying to send PUT request. struct curl_slist *headers = NULL; curl = curl_easy_init(); std::string paramiters = "<data_file><archive>false</archive><data_type_id>0a7a184a-dcc6-452a-bcd3-52dbd2a83ea2</data_type_id><data_file_name>backwardstep.stt</data_file_name><description>connectionfile</description><job_id>264cf297-3bc7-42e1-8edc-5e2948ee62b6</job_id></data_file>"; if (curl) { headers = curl_slist_append(headers,

setting cookie through curl

为君一笑 提交于 2019-12-24 04:40:44
问题 I am trying to set cookie through cURL in PHP but it fails. my php code looks like this $ch=curl_init(); $url="http://localhost/javascript%20cookies/test_cookies.html"; curl_setopt($ch, CURLOPT_COOKIE, 'user=1'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $contents = curl_exec($ch); curl_close($ch); echo $contents; ?> the file test_cookies.html contains javascript that checks for a cookie and if it finds it dispalys the content with additional user

How to get and compare libcurl version?

自作多情 提交于 2019-12-24 03:34:47
问题 I am using libcurl setting OAuth 2.0 access token. Since libcurl 7.33 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_XOAUTH2_BEARER, char *token); option was added. Now I need to get the libcurl version and compare it with 7.33. In case where version is 7.33 or higher I will use CURLOPT_XOAUTH2_BEARER otherwise I will do something else. I know I should somehow use curl_version_info_data *curl_version_info( CURLversion type ); but I have no idea, how the data in struct look like and how to

php curl post data to get value form referred url

烈酒焚心 提交于 2019-12-24 03:25:14
问题 I want to send post data to a page to get value. The problem is that I want to get data form abc.com . And abc.com opens only if user comes to abc.com from abc.com/previous url . Maybe it is is doing some session or cookies to authenticate. I have no idea. What I want to do is get data from abc.com. Is there any way via curl to do it? My php code: When you run the code it says url has be moved as for this url you need to come from old refer url then it works in browser $SearchBy = "2";

Simple telnet example in LIBCURL - C++

删除回忆录丶 提交于 2019-12-24 01:24:58
问题 I need to fing simple TELNET example in LIBCURL (curl.haxx.se/libcurl) (C++) I searched over this site, but I don't found any simple example. I need only to connect to TELNET, authenticate, and send message. Thanks 回答1: All you can do in libcurl is send data and recieve data. There is no way to wait for response or send data based on response. The whole point of libcurl is to handle waiting for data and responses for HTTP or FTP. That being said, you may be able to do something with CURLOPT

Installing libCurl - ruby 1.9.3 .. rails 3.2.12 .. Windows

六眼飞鱼酱① 提交于 2019-12-24 00:49:32
问题 So, I'm trying to get feedzirra up and running... ruby 1.9.3p448 Rails 3.2.12 I went to http://curl.haxx.se/download.html#Win32 and downloaded Win32 2000/XP 7.32.0 libcurl SSL . It may be obvious, but this is libcurl -v 7.32 . I unzipped the aforementioned file into c:\libcurl ( so the bin, lib, and whatnot are directly in libcurl ). I added c:\libcurl\bin to the PATH . While in my app's working directory, I told bundler where to find the cURL dependencies with bundle config build.curb --with

remote-https is not a git command when cloning repo

半腔热情 提交于 2019-12-23 19:59:02
问题 On a Windows (version 10) machine, with the latest git client at the time of writing ( 2.18.0.windows.1 ), cloning repositories using HTTPS fails with error: git: 'remote-https' is not a git command. After a bit of research it turns out that git comes with several remote-<command> utilities, with remote-https being one of them. The error message therefore seems to tell us that `remote-https is not installed on the machine. After a bit more research, it seems that similar problems for other

Sending a file from memory (rather than disk) over HTTP using libcurl

家住魔仙堡 提交于 2019-12-23 13:19:34
问题 I would like to send pictures via a program written in C + +. - OK It works, but I would like to send the pictures from pre-loaded carrier to a variable char (you know what I mean? First off, I load the pictures into a variable and then send the variable), cause now I have to specify the path of the picture on a disk. I wanted to write this program in c++ by using the curl library, not through exe. extension. I have also found such a program (which has been modified by me a bit) 回答1: CURLFORM

Is curl_multi_exec() a blocking call?

戏子无情 提交于 2019-12-23 09:56:27
问题 Was just curious if the curl_multi_exec() call in PHP is blocking or non-blocking call. 回答1: Shot answer : curl_multi_exec() is non-blocking Longer answer : curl_multi_exec() is non-blocking , but blocking can be made with the combination of curl_multi_select , which blocks until there is activity on any of the curl_multi connections. Edit: Currently I am working on a crawler, this is outline of a piece of code I used. do { $mrc = curl_multi_exec($mh, $active); if($to_db_queue->count()>0){