2011-08-25 2 views
0

아래 코드와 같이 PHP 서버에 요청합니다.PHP에서 post 메소드의 데이터 읽기

StringEntity stringEntity = new StringEntity(myString, "UTF-8"); 
httppost.setEntity(stringEntity); 
httppost.addHeader("Accept", "application/xml"); 
httppost.addHeader("Content-Type", "application/xml"); 

이제 xml 데이터를 PHP 서버로 읽고 싶습니다.

어떻게 읽을 수 있습니까?

답변

1
$xmlstr= file_get_contents('php://input'); 
$xml = new SimpleXMLElement($xmlstr); 
var_dump($xml)