Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Request #14089 support of "header" stream context option
Submitted: 2008-06-06 07:02 UTC
From: kawai Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Client (version CVS)
PHP Version: 5.2.6 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-06-06 07:02 UTC] kawai (Hiroaki Kawai)
Description: ------------ In a normal case, content-type of a file we upload will be set to "application/x-www-form-urlencoded", because underlying HTTP_Request sets it as a default content-type. I wanted to set the content-type in uploading. Test script: --------------- <?php ini_set('error_reporting',E_ALL); require_once('HTTP/WebDAV/Client.php'); $context=stream_context_create(array('webdav'=>array('user_agent'=>'MyClient/0.1', 'header'=>'Content-type: text/plain'))); $data="Hello world"; file_put_contents('webdav://127.0.0.1/ddpdav/entry.php/jkassytk/38/mini',$data,null,$context);

Comments

 [2008-06-11 21:32 UTC] hholzgra (Hartmut Holzgraefe)
implemented in a different way: - refactored request generation so that headers etc, are set in only one place - added new context element "content_type" (general header setting too dangerous here imho)
 [2008-06-11 21:32 UTC] hholzgra (Hartmut Holzgraefe)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.