Questions tagged [curl]

5

votes
1

answer
7.5k

Views

Kerberos authentication with SSPI

Note: I manage to make some progress, see the edit for my current question, thanks. I would like to use libcurl on Windows to access websites with a Kerberos/GSSAPI authentication. I first tried to work it out with MIT Kerberos, but I also require NTLM authentication using SSPI (libcurl doesn't supp...
adaigle
2

votes
1

answer
377

Views

How can I signing to a Symfony project that use sfGuardUser using cURL?

I need to log in to a system using curl commands but I don't know how to skip CSRF authentication. I tried the following but it didn't work: curl -d 'form_username_input_name=username&form_passowrd_input_name=password' url How do I achieve what I want?
Hazem Hagrass
2

votes
1

answer
8.4k

Views

Cannot get Http on git to work

I am using gitbash for git on my thumbdrive. I have a firewall blocking me and would like to set up my git for http access. I use github and I have seen all kinds of infomation on how to do so but I do not understand enough to make it work for my self. I have curl enabled in the php.ini file and...
skwidgets
11

votes
3

answer
72.6k

Views

Posting JSON data to API using CURL

When I'm posting json data to API using curl - I'm not getting any output. I would like to send email invitation to recipient. $url_send ='http://api.address.com/SendInvitation?'; $str_data = json_encode($data); function sendPostData ($url, $post) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_R...
ArkNet
2

votes
2

answer
1.6k

Views

Android Google Cloud Messaging - push delivered to the device, but device not displaying the push notification

I have some server side code with which I am trying to create a push notification. And the result looks like this: {'multicast_id':8714083978034301091,'success':1,'failure':0,'canonical_ids':0,'r‌​esults':[{'message_id':'0:1350807053347963%9aab4bd8f9fd7ecd'}]} and here is the PHP code I used to...
Genadinik
6

votes
2

answer
7k

Views

Cannot delete document because of update conflict

This is how I get the document and check for newer revisions: curl http://localhost/cdb/characters/e6b153975174556adc0b344e9a000a7f?revs=true returns: {'_id':'e6b153975174556adc0b344e9a000a7f','_rev':'1-25b25539eca3944ef8d8f20748ed4902','name':'Barack Obama','position':'US President'} Then I try to...
Kristian
1

votes
1

answer
1.4k

Views

Curl 7.12.0 or later is required for timestamping support

configure: error: Curl 7.12.0 or later is required for timestamping support I have this message while trying to ./configure another package. CURL is installed There is an output of [email protected]:$> apt-cache search libcurl gnupg - GNU privacy guard - a free PGP replacement libcurl3 - Multi-protocol...
Benjamin Harel
1

votes
5

answer
1.3k

Views

How do I post to a form and populate a select multiple?

I'm doing something a bit strange here, I'm querying data out of my local database and posintg it to Salesforce form using cURL. The data posts correctly to Salesforce. However, the select multiple is not getting the correct values selected. See $sd['location'] below in my code: //init curl $ch = c...
mike
5

votes
4

answer
10.2k

Views

cURL returns 404 while the page is found in browser

there is already similar questions on stackoverflow, but none of their solutions have been working for me. I'm trying to grab a page on LoveIt.com with cURL, but it returns me a 404 error, while the url works fine in the browser : $url = 'http://loveit.com/loves/P0D1jlFaIOzzZfZqj_bY3KV'; $curl = cu...
gordie
3

votes
1

answer
2.3k

Views

Passing boolean parameters in Ruby on Rails

My Ruby on Rails function should receive a boolean parameter, check it and, if it is true, do something. def isReady if (params[:ready] == true) doSomething() end end However, with the example below we never get inside this if (but it enters the function), probably because the parameter is passed as...
Arturo
39

votes
3

answer
36.6k

Views

How to pass multiple parameters to cron job with curl?

I'm running two cron jobs: This one executes without a problem: curl -sS http://example.com/cronjob.php?days=1 But this doesn't run at all: curl -sS http://example.com/cronjob.php?days=1&month=1 Is this because of the ampersand (&)? If yes, how to pass multiple parameters? Using argv is not an optio...
Yeti
5

votes
1

answer
863

Views

Send to github via curl command line (Windows)

I asked a related question and realized I wasn't asking the right question (i.e., this isn't about git). The question is how to push a project to github without first creating the project in the clouds using R. Currently you can do this from the git command line in RStudio using info from this quest...
Tyler Rinker
4

votes
1

answer
3.1k

Views

My password curl is failing sometimes?

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $PathUrl); curl_setopt($ch, CURLOPT_USERPWD, 'someuser:somepass'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); $info = curl_getinfo($ch); Any ideas on why it works about 30% of the time and the other 70% if fails....viewing th...
Matt Elhotiby
5

votes
2

answer
3.2k

Views

PHP: curl and stream forwarding

Curl has lots of options that make it easier for my use-case to request data from another server. My script is similar to a proxy and so far it is requesting the data from another server and once the result data is complete, it's send to the client at once. user visits http://te.st/proxy.php?get=xyz...
ledy
5

votes
2

answer
6k

Views

PHP cURL timeout is not working

I'm having a server issue. I'm running a local server (for developing) and I've changed my local server from MAMP to XAMPP. However, on XAMPP, the cURL option CURLOPT_TIMEOUT_MS or CURLOPT_CONNECTTIMEOUT_MS gives me the next error: Warning: curl_setopt() expects parameter 2 to be long, string given...
Tim S.
5

votes
1

answer
5.8k

Views

Posting a file to a web service with Guzzle

I've been trying for several hours to make a POST request that sends a file. First tried a simple file_get_contents() with stream context, doesn't seem to work. I never get a response back while the GET on a different URL works. I searched on the web for an HTTP client and found Guzzle which was do...
Mathieu Dumoulin
2

votes
3

answer
81

Views

Translate curl to Javascript ajax code

How can I translate this curl script to an AJAX request in JavaScript? curl -X POST -d 'grant_type=password&username=admin&password=Demo1234' -u ': ' http:///url/to/auth
Jean Manzo
5

votes
1

answer
16.9k

Views

Curl PHP File Upload

Hey, trying to post a file using curl and all is working great. I have one problem. I can't declare my file outside of my post_file() function. I call this function in my application many times so want it to be reusable. So this works: function call_me(){ $file_path = '/home/myfile.mov'; $url = 'htt...
bradley
4

votes
1

answer
724

Views

Cannot get imgur v3 api request to authorize using curl or other bash utility

I'm trying to scrape some public data from imgur.com using the v3 imgur api but whenever I make a request using curl I'm getting a 401. This is how I'm calling the API (using this example from the example python app) - curl -F 'Authorization=Client-ID ' https://api.imgur.com/3/gallery/hot/viral/0.j...
Dave
19

votes
9

answer
17.4k

Views

Twilio PHP - SSL certificate: self signed certificate in certificate chain

I'm struggling with this error when trying to send a message via Twilio using their PHP library: Fatal error: Uncaught exception Services_Twilio_TinyHttpException with message SSL certificate problem: self signed certificate in certificate chain thrown in F:\path\to\site\twilio-php\Services\Twilio\T...
jd182
2

votes
2

answer
8.7k

Views

How to write PHP curl DELETE request

I'm referencing DigitalOcean's API docs, and they give the following example on how to delete a droplet here: curl -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' 'https://api.digitalocean.com/v2/droplets/[DROPLET_ID]' How can I write this in PHP curl? I currently...
user1661677
12

votes
2

answer
16.5k

Views

PHP, How to Redirect/Forward HTTP Request with header and body?

I have a PHP page, main.php which is on server 1. I have a PHP page main.php (same page, different code) on server 2. main.php is a WebService. I would like to forward the full HTTP request made to server 1, to server 2, so that when a user sends an HTTP request to main.php (server 1), it would get...
user2721348
5

votes
1

answer
2.6k

Views

“Object Moved” error in using the RCurl getURL function in order to access an ASP Webpage

I am trying to use the getURL function of RCurl Package in order to access an ASP Webpage as: my_url
user274136
13

votes
2

answer
5.8k

Views

How to fix error: failed to download on rbenv install

On fresh, new CentOS 7.0 VM Rbenv installation will not install rubies for me [[email protected] ~]$ rbenv install 2.2.4 Downloading ruby-2.2.4.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 error: failed to download ruby-2.2.4.tar.bz2 BUILD FAILED (CentOS Linux 7 using rub...
onknows
2

votes
1

answer
846

Views

C++ CURL cannot set header

I am currently working on a program about CURL. I have written the following codes to add a custom header:- struct curl_slist *chunk = NULL; chunk = curl_slist_append(chunk, 'Another: yes'); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); The above codes are fine, but if I change the codes to...
Pingu
28

votes
1

answer
29.6k

Views

Curl - Exclamation mark in User Auth/Password

Having a problem with CURL and the HTTP User and password Auth methods, it is not liking the exclamation mark, I've tried escaping the following ways: Tried and failed... /usr/bin/curl -u 'UserName\WithSlash:PasswordWithExclamation!' https://test.com/ /usr/bin/curl -u UserName\\WithSlash:PasswordWit...
MichaelICE
31

votes
3

answer
82.7k

Views

How to enable curl in Wamp server

I try 30 combination of answer and forum topic but did not find the right answer. I do all but how I can enable the curl int wamp server becouse I need that? is there any solution? I try to uncomment - dont work? I try to chech into wamp task bar icons - php extension - php_curl I try to copy php_cu...
user1766361
8

votes
5

answer
16.7k

Views

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

Currently, I am doing a project on laravel5. I use socialize for Facebook authentication,But I got cURL error Mentioned below. RequestException in CurlFactory.php line 162: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-error...
Nilesh
2

votes
1

answer
2.2k

Views

Property “CWebApplication.curl” is not defined

Hi guys i am new to both here and Yii i am creating an web app using api for that i am using curl i have done steps as per tutorial given in yii. but it still shows this error Property 'CWebApplication.curl' is not defined help me with your ideas..
raj
2

votes
2

answer
2.5k

Views

.htaccess password auth but allow post request

I want to protect my domain with a password because I just use it to test scripts, but I need to allow curl HTTP POST request. Is this possible? current .htaccess: #AuthUserFile /home/domain/.htpasswds/.htpasswd #AuthType Basic #AuthName 'Protected Domain' #Require valid-user PHP curl request $handl...
chuckieDub
13

votes
2

answer
8.8k

Views

Elasticsearch GET request with request body

Isn't it against REST-style approach to pass a request body together with GET request? For instance to filter some information in Elasticsearch curl localhost:9200/megacorp/employee/_search -d '{'query' : {'filtered' : {'filter' : {'range' : {'age' : { 'gt' : 30 }}},'query' : {'match' : {'last_name...
yurko
3

votes
3

answer
5.6k

Views

Using CloudFlare API via PHP/Curl returning error

I am working on updating my DNS via a PHP script. I've looked at the API documentation relating to cURL so I am trying to convert the cURL psot to be PHP. I have the following code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.cloudflare.com/client/v4/zones//dns_records/'); curl_set...
Boardy
2

votes
2

answer
355

Views

Error Converting Curl Request to Net::HTTP

I am trying to translate a curl request to ruby. I don't understand why this works: curl -H 'Content-Type: application/json' -X POST -d '{'username':'foo','password':'bar'}' https://xxxxxxxx.ws/authenticate while this doesn't: uri = URI('https://xxxxxxxx.ws/authenticate') https = Net::HTTP.new(uri.h...
masciugo
6

votes
2

answer
512

Views

PHP Running Background jobs without waiting for response Non Blocking mode Like Trigger type

Objective My basic objective is to acheive asynchornous triggers in PHP using Yii2 Web Application I need to run the php batch jobs but i dont want to wait in the browser / cron for doing the job. For running the job i need to use different file of my application like http://myapp/foojob.php The f...
Babu
1

votes
3

answer
2.8k

Views

Requests, Mechanize, urllib fails but cURL works

Whilst attempting to access this site through requests, I receive: ('Connection aborted.', error(54, 'Connection reset by peer')) I have also tried to access the site through mechanize and urllib, both failed. However cURL works fine (see end for code). I have tried requests.get() with combinations...
Alexander McFarlane
2

votes
3

answer
258

Views

How do I prevent access to a php script if not called with a comandline application like curl

How do I prevent access to a php script if not called with a comandline application like curl? I'm working on a web application and it uses a cron script to run it's services. I'm using codeigniter so I have to use a url not a file path.
Robert Hurst
2

votes
1

answer
3.9k

Views

How to send data to influxdb via post call without using curl?

i am new to influxdb and i was trying to add data to influx db . I found on the documentation page that it can be done using curl. curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000' but i want to hit it from...
Mohd Waseem
2

votes
2

answer
1.2k

Views

Optimising PHP cURL based link checker script - currently very slow

I'm using a PHP script (using cURL) to check whether: The links in my database are correct (ie return HTTP status 200) The links are in fact redirected and redirect to an appropriate/similar page (using the contents of the page ) The results of this are saved to a log file and emailed to me as an at...
Tomcat
3

votes
1

answer
619

Views

How to get the timestamp of curl request before it sends?

This might be impossible but... I'd like to grab the Request Time of a CURL request just before I send it out. The goal here is to check that the $_SERVER['REQUEST_TIME'] that I receive on the other end is the same as the request time I have when I send it out. I tried just using when I send the CUR...
Brian Weinreich
4

votes
1

answer
4.3k

Views

How use php curl to send push message in Firefox

I have implemented push notifications for Chrome, and in the point when I need send push message to GCM, I used the following PHP function: function send_push_message($subscription_ids){ // Set GCM endpoint $url = 'https://android.googleapis.com/gcm/send'; $fields = array( 'registration_ids' => $sub...