note 97383 added to function.curl-setopt
| From: | clint at fewbar dot com | Date: | Fri, 16 Apr 2010 21:56:04 +0000 |
| Subject: | note 97383 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168334@lists.php.net to get a copy of this message | ||
If you have turned on conditional gets on a curl handle, and then for a subsequent request, you
don't have a good setting for CURLOPT_TIMEVALUE , you can disable If-Modified-Since checking
with:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $foo);
curl_setopt($ch, CURLOPT_TIMEVALUE, filemtime($foo_path));
curl_setopt($ch, CURLOPT_TIMECONDITION, CURLOPT_TIMECOND_IFMODIFIEDSINCE);
curl_exec($ch);
// Reuse same curl handle
curl_setopt($ch, CURLOPT_URL, $bar);
curl_setopt($ch, CURLOPT_TIMEVALUE, null); // don't know mtime
curl_setopt($ch, CURLOPT_TIMECONDITION, 0); // set it to 0, turns it off
curl_exec($ch);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 207.7.104.10
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/97383
Del: integrated -- https://master.php.net/note/delete/97383/integrated
Del: useless -- https://master.php.net/note/delete/97383/useless
Del: bad code -- https://master.php.net/note/delete/97383/bad+code
Del: spam -- https://master.php.net/note/delete/97383/spam
Del: non-english -- https://master.php.net/note/delete/97383/non-english
Del: in docs -- https://master.php.net/note/delete/97383/in+docs
Del: other reasons-- https://master.php.net/note/delete/97383
Reject -- https://master.php.net/note/reject/97383
Search -- https://master.php.net/manage/user-notes.php