Reading Raw Post Data in PHP

November 14, 2007 – 5:16 pm

Perhaps you’d like to just sent XML over post, and not have xml=your_nodes_and_stuff_here. No sweat.

$xml = urldecode(file_get_contents('php://input'));

Enjoy.

This can now be called with:

curl -d "some_xml_here" http://yoursite.com/pagename

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit

Post a Comment