curl

How to upload with curl client certificate authentication?

Instead of using basic or digest authentication for an upload, could it be possible for a service to generate a certificate for the client to download for authenticated uploads? Keygen could be used for example, though it might be more straightforward to "Save the certificate" somewhere. Once the user has the certificate, the user is ab...

Importing a JSON feed from an external source in Javascript

I'd like to load a JSON feed from an external source using Javascript; what's the best method? I've been working a lot in PHP where it would be easy to do so with file_get_contents or cURL. Is there a related function or process in Javascript? ...

Posting to posterous.com through posterous api

Hi, I am using curl and i want to post through posterous api. I am using this method posterous.com/api/newpost My code is $url="userid" $posturl = "posterous.com/api/newpost"; $session = curl_init($posturl); $postVars = array( "site_id" => $url, "body"=>$message ); curl_setopt($session, CURLOPT_POST, true); curl_setopt($sess...

curl_exec function causes server to drop the connection

Hi Everyone, I am having a strange issue with the following function that I have written. Briefly, this function connects to a URL and fetches the output by using curl functions. However, when I execute this function, I get a "server unexpectedly dropped the connection" message: /** * Connects to remote URL and posts parameters, retur...

Twitter Api

Hi, I am using twitter api for posting. I want to know is there any method for changing the application name for example when i post it shows: about 1 hour ago from web it should be converted to about 1 hour ago from myapplication name Please guide me on this. ...

How to pass HTTP AUTH values via prototype Ajax.Request()?

Is there any way to pass HTTP AUTH username and password along with an Ajax.request()? Basically, I'm trying to find the equivalent of: curl user:pass http://url.com Is seems this has to be available, but I can't figure it out. If not, is there another JS alternative? ...

equivalent of curl for Ruby?

Is there a curl library for Ruby? ...

using php and curl to update mediawiki

I've been working on a php script to update mediawiki entries, however whenever I run it it doesn't seem to update the wiki at all and just returns the article page unedited. I've included a section which logs into the wiki first and I've successfully read information off the wiki but I have not been able to update it. Is there somethi...

Using file_get_contents or curl to url on same server

I have a PHP script that needs to process the same site's RSS feed. Specifically, I'm displaying the most recent blogs from the WordPress RSS feed on the home page. On our staging server it worked fine but on our live (which is a completely different, but LAMP) hosting environment it's not working. I can run file_get_contents or cur...

Nested model parameters during an HTML post

I'm been playing with calling my rails controller using an HTTP POST. I can get it to work with a curl command such as this, given a model named item and an attribute in that item called name: curl -X POST -d "<item><name>myname</name></item>" -H "Content-Type: text/xml" http://localhost:3000/items.xml What I'm curious about is how t...

curl sending GET instead of POST

Actually, it's gotten so messy that I'm not even sure curl is the culprit. So, here's the php: $creds = array( 'pw' => "xxxx", 'login' => "user" ); $login_url = "https://www.example.net/login-form"; //action value in real form. $loginpage = curl_init(); curl_setopt($loginpage, CURLOPT_HEADER, 1); curl_setopt($loginpage, C...

How do I make an asynchronous GET request in PHP?

Hello all, I wish to make a simple GET request to another script on a different server. How do I do this? In one case, I just need to request an external script without the need for any output. make_request('http://www.externalsite.com/script1.php?variable=45'); //example usage In the second case, I need to get the text output. $o...

How can I POST a file to a REST server without writing the file to disk with PHP?

I'm trying to send an XML file to a server as part of the POST method for an internal API. All the PHP documentation points to using the $postVars['file']='@/path/to/file.xml' to actually send the file. I want to send the file from a string, but it still needs to be sent as a file upload, not a string. Help? ...

curb(curl) for jruby?

i'm trying to use curl with jruby to get some response times for webpages/files. normally in ruby this would not be an issue and i could just install the gem (gem install curb) and all is well. curb appears to be incompatible with jruby, so is there an alternative that i can use to get web page load times in a similar fashion? i looked ...

Persistent/keepalive HTTP with the PHP Curl library?

I'm using a simple PHP library to add documents to a SOLR index, via HTTP. There are 3 servers involved, currently: The PHP box running the indexing job A database box holding the data being indexed The solr box. At 80 documents/sec (out of 1 million docs), I'm noticing an unusually high interrupt rate on the network interfaces on...

Is a site potentially not-logonable?

Hi, I'm having some problems logging on to a site via cURL (not just me but an outsourcer too). So I'm left wondering: Are some sites impossible to log onto via cURL? That's the question. Thx in advance for your replies! ...

XmlHttpRequest vs cURL

I was wondering if anyone has done any testing on the speed differences of cURL and XHR (in regards to the time it takes to complete a request, or series of requests). Specifically I'm wondering because I would like to use XHR to go to php script, and use cURL from there to grab a resource. The php page will ensure ensuring the data is ...

curl: How to limit size of GET?

I want to retrieve the first 10k bytes from a URL with curl (using PHP in my case). Is there a way to specify this? I thought CURLOPT_BUFFERSIZE would do this, but it just appears to determine the size of a buffer that is reused until all of the content is retrieved. ...

Confusion with mail.google.com, cURL and http://validator.w3.org/checklink

Hello. I am building a basic link checker at work using cURL. My application has a function called getHeaders() that returns an array of HTTP headers: function getHeaders($url) { if(function_exists('curl_init')) { // create a new cURL resource $ch = curl_init(); // set URL and other appropriate options ...

reCaptcha Widget using PHP/Curl

Hello, I'm looking to build a small script that can load reCaptcha images from another website. Seeing as the reCaptcha widget works using Javascript, is there anyway for one to capture the image generated using CURL? ...