note 112318 added to function.http-get-request-body

From: Date: Fri, 31 May 2013 20:31:34 +0000
Subject: note 112318 added to function.http-get-request-body
Groups: php.notes 
Request: Send a blank email to php-notes+get-195017@lists.php.net to get a copy of this message
In case this saves anyone else some frustration, the "Content-Length" header decides what will be returned for "php://input". If you leave it out while testing, nothing will be returned for "php://input" or $HTTP_RAW_POST_DATA. For example, if you are trying to test out a custom SOAP server app and you send a request like this without a Content-Length set: ----- POST /soap_service.php HTTP/1.1 Authorization: Basic abcdefgh User-Agent: SOAPy McSOAPclient Host: example.com Accept: */* MIME-Version: 1.0 Content-type: text/xml; charset=utf-8 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cat="http://com.soapy/foobar"><soapenv:Header/><soapenv:Body><foo:ManageBar><foo:task id="1"><foo:getBar type="helloworld"/></foo:task></foo:ManageBar></soapenv:Body></soapenv:Envelope> ---- "php://input" will always return and empty string. ---- Server IP: 69.147.83.199 Probable Submitter: 24.69.109.53 ---- Manual Page -- http://php.net/manual/en/function.http-get-request-body.php Edit -- https://master.php.net/note/edit/112318 Del: integrated -- https://master.php.net/note/delete/112318/integrated Del: useless -- https://master.php.net/note/delete/112318/useless Del: bad code -- https://master.php.net/note/delete/112318/bad+code Del: spam -- https://master.php.net/note/delete/112318/spam Del: non-english -- https://master.php.net/note/delete/112318/non-english Del: in docs -- https://master.php.net/note/delete/112318/in+docs Del: other reasons-- https://master.php.net/note/delete/112318 Reject -- https://master.php.net/note/reject/112318 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195017) next »