Read data of post method in PHP
I am requesting to PHP server as below code snippet
StringEntity stringEntity = new StringEntity(myString, "UTF-8");
httppost.setEntity(stringEntity);
httppost.addHeader("Accept", "applic开发者_如何学运维ation/xml");
httppost.addHeader("Content-Type", "application/xml");
Now I want to read that xml data into PHP server.
How can I read that?
$xmlstr= file_get_contents('php://input');
$xml = new SimpleXMLElement($xmlstr);
var_dump($xml )
精彩评论