rubing Posted July 22, 2008 Share Posted July 22, 2008 I am trying to start a RESTful web service. The service would accept xml via $_POST. And then respond with xml, for example: <!-- Data Posted from user --> <xvar></xvar> <yvar></yvar> <zvar>44</zvar> <!-- Data Posted Back to user --> <xvar>22</xvar> <yvar>53</yvar> <zvar>44</zvar> How do I put this xml into $_POST and then accept process it and respond? Is this a stream based procedure, or do I need to configure a socket that listens for it. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted July 22, 2008 Share Posted July 22, 2008 Have you heard of cURL. If not, just take a look at this shameless self promotion of my blog: http://blog.cnizz.com/2007/05/02/phplinux-performing-an-http-post-the-easy-way/ Basically you have a page that accepts POST data, then the client (some other web server) has another page used to handle the data returned which is just another page that accepts POST data. Its simple really, your other options is building a web service, but the cURL post method is much easier. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.