Re: New globals for PUT and DELETE

From: Date: Wed, 15 Oct 2014 15:05:01 +0000
Subject: Re: New globals for PUT and DELETE
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to internals+get-78096@lists.php.net to get a copy of this message
2014-10-15 4:30 GMT+03:00 Stas Malyshev <smalyshev@sugarcrm.com>: > Hi! > >> PHP today to enable successful & easy implementation of RESTful > interfaces. > > Having done this, I beg to differ. > >> Try to send a parameter in the body, by PUT method, for reading >> parameters have to use an ugly way file_get_contents(‘php://input') > > What exactly is the problem in this one-liner? > >> But yet worst, you can not do upload files and send parameters because >> - php://input is not available with enctype="multipart/form-data" > > I'm not sure I understand what you're trying to do, could you explain in > more detail with examples? PUT /url Content-type: application/x-www-form-urlencoded parse_str (file_get_contents(‘php://input'), $_POST) // Ok PUT /url Content-type: multipart/mixed; boundary="xxxx" file_get_contents(‘php://input') // Empty string

« previous php.internals (#78096) next »