我向 PHP 服务器请求如下代码 fragment
StringEntity stringEntity = new StringEntity(myString, "UTF-8");
httppost.setEntity(stringEntity);
httppost.addHeader("Accept", "application/xml");
httppost.addHeader("Content-Type", "application/xml");
现在我想将 xml 数据读入 PHP 服务器。
我怎样才能读到它?
最佳答案
$xmlstr= file_get_contents('php://input');
$xml = new SimpleXMLElement($xmlstr);
var_dump($xml )
关于java - PHP中post方法读取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7189712/