note 83876 added to curl.examples

From: Date: Mon, 16 Jun 2008 17:39:21 +0000
Subject: note 83876 added to curl.examples
Groups: php.notes 
Request: Send a blank email to php-notes+get-140507@lists.php.net to get a copy of this message
This simple code work fine using libcurl versions before 7.18.x. <?php $ch = curl_init("www.example.com/curl.php?option=test"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); echo $output; ?> If you have some trouble (Ex.: Failed to open/read local data from file/application) using a similar code with libcurl 7.18.x, try to add the option curl_setopt($ch, CURLOPT_POSTFIELDS, ""). I think there was a change in the option CURLOPT_POST. Now, to use this option, it seems to be necessary to set the option CURLOPT_POSTFIELDS. ---- Server IP: 200.185.109.13 Probable Submitter: 150.164.3.57 ---- Manual Page -- http://www.php.net/manual/en/curl.examples.php Edit -- https://master.php.net/note/edit/83876 Del: integrated -- https://master.php.net/note/delete/83876/integrated Del: useless -- https://master.php.net/note/delete/83876/useless Del: bad code -- https://master.php.net/note/delete/83876/bad+code Del: spam -- https://master.php.net/note/delete/83876/spam Del: non-english -- https://master.php.net/note/delete/83876/non-english Del: in docs -- https://master.php.net/note/delete/83876/in+docs Del: other reasons-- https://master.php.net/note/delete/83876 Reject -- https://master.php.net/note/reject/83876 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140507) next »