curl

What is curl and what are its uses for rails developers?

Ive seen mentions of curl here and there on rails blogs and ive scanned some posts here on stackoverflow but im still a bit in the dark as to its use especially when it comes to rails development. Is it useful for testing? Im currently learning the ins and outs of testing and one of the things i need to do is test a before filter that ...

PHP: Can CURL follow meta redirects

Hi, CURL can follow header redirects with the use of CURLOPT_FOLLOWLOCATION but is it possible to follow meta refresh redirects? Thanks ...

How can I call curl from a Perl CGI script?

I have a CGI (perl) script that is attempting to call curl using the open command: @curl = ('/usr/bin/curl', '-S','-v','--location', $url, '-H', 'Content-Type:'.$content_type, '-H', "Authorization: $authorization", '-H', "X-Gdata-Key:$gdata_key", ...

How to access the FirstData web service integration WSDL file?

FirstData has horrendous customer support, but I have to integrate with their Global Gateway web service for a project I'm working on. I'm simply trying to run the Axis2 wsdl2java tool according to the instructions in their manual. This basically consists of adding the keyStore and keyStorePassword JVM parameter. I've done both, but I ...

Why do I get a CURLE_URL_MALFORMAT when trying to http post?

Here's the code (extracted from an existing application): CURL *curl = curl_easy_init(); _ASSERTE(curl); string url = "http://127.0.0.1:8000/"; char *data = "mode=test"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); curl_easy_setopt(curl, CURLOPT_URL, url); CURLcode res = curl_easy_perform(curl); bool success = (res == CURLE_OK);...

PHP, curl, and raw headers

When using the PHP curl functions, is there anyway to see the exact raw headers that curl is sending to the server? ...

Programmatically access & post a form that requires session

Hello: I am attempting to use PHP and cURL to: Access a web-form & maintain session Post the data to that form with session in place In my head, I see it as two separate functions, one to get the form (initiate session) and another to post the data. ...

Are PayPal cookies linked to an IP address?

I have been experimenting with curl for accessing the PayPal payment authorisation site using PHP. e.g. ... $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $nvp); curl_setopt($ch, CURLOPT...

PHP: Curl can't grab a text-only page on my own site

I'm attempting to use curl inside php to grab a page from my own web server. The page is pretty simple, just has some plain text output. However, it returns 'null'. I can successfully retrieve other pages on other domains and on my own server with it. I can see it in the browser just fine, and I can grab it with command line wget jus...

capturing curl stdout into variable in PHP

Task Downloading binary files from a remote media processing server to a web server. This works but I cannot capture the curl stdout output $result = shell_exec('curl -v http://domain.com/images/dir/dir/dir/file.jpg --user username:password -o /usr/www/htdocs/images/dir/dir/dir/file.jpg'); Note: I have had no luck using the PHP cu...

Handle CURL headers before downloading body

Using PHP and CURL (unless there is a better alternative then CURL in this case), is it possible to have a php function handle the header response before downloading the file? For example: I have a script that downloads and processes urls supplied by the user. I would like to add a check so that if the file is not valid for my process...

How to automatically retrieve current adword spend from google

Does anyone know a guide or tutorial into how to access the Google adwords reports? I'm trying to pull in to my application the advertising spend per day (current to the time of checking or last Google update). I can't quite find the API docs or methods for getting the spend. Does anyone know of any good tutorials? Or can you point me ...

Getting the cURL stream in PHP

Hello, 1/ If I run curl_exec with no options, the fetched page gets output on php's standard output (the html page being served back). 2/ If I run it with the RETURNTRANSFER option set, I can get the whole page in a variable. How can I get a stream, that I can then manually parse? In case 1/ I cannot access the data to parse it and in...

Get a remote FLV using PHP and curl

I want to know if it's possible to get a remote flv file and have it 'stream' using PHP and exec function. I have 'curl' in my environnement so i want something like : exec ('curl http://myhosts.com/myflv.flv', $out); print $out; Problem is that $out is returned as an array; i want to output the 'raw' stream returned by curl. ...

Make cURL behave like exactly like form

Hi! I have a form on my site which sends data to some remote site - simple html form. What I want to do is to use data user enters into form for statistical purposes. So I instead of sending data to the remote page I send it first to my script which resends it the remote site. The thing is I need it to behave in exact way the usual form...

Why would curl ignore CURLOPT_TIMEOUT_MS (but honor CURLOPT_TIMEOUT)?

I am using curl to call a web service API. The service can unresponsive so I want to set a timeout. When I use CURLOPT_TIMEOUT things work as expected. But when I use CURLOPT_TIMEOUT_MS (note the 'MS' for milliseconds) the timeout doesn't appear to kick in at all. php.net tells me that the latter was available since PHP version 5.2.3, an...

PHP downloading question

On my site, users can input links to files and I can stream the download process to them through my server. I use a system like this: header('Cache-control: private'); header('Content-Type: application/octet-stream'); header('Content-Length: ' . $r[2]); header('Content-Disposition: filename=' . $theName); flush(); $file = fopen($file...

PHP using CURL: is there a way to emulate a cookie instead of saving it to a file?

I access a REST api service that utilizes a variable called session_id. The API calls for this to be stored in a cookie and I accomplish this as follows: $ch = curl_init(); // initialize curl handle curl_setopt($ch, CURLOPT_URL, $url); //set target URL curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);// allow redirects...

POST an mp3 file using CURL

Hey all, I have been searching and trying different configurations for POSTing mp3 files via CURL for a few hours, but none seem to work. The most recent form I have settled on looks like this: curl -F "[email protected];type=audio/mpeg" -A "Mozilla/5.0" http://65.173.255.180:8000/accounts/user/songs/ This format seems to have...

Curl and cookie

Hello! I'm using cURL to log in a website, but I don't know how to get/use the cookies I get. Does anybody has an idea? Thanks ...