Jump to content

REST $_POST web service


rubing

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/115963-rest-_post-web-service/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.