2014-10-15 4:30 GMT+03:00 Stas Malyshev <smalys...@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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php