News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell's Blog:
Accessing Incoming PUT Data from PHP
July 31, 2008 @ 12:05:35

For a recent REST web service project, Lorna Mitchell had to put together a server for the remote clients to use. She started with a GET request then moved to handling a POST request then to a PUT request - that's where the difficulty came in:

PHP doesn't have a built-in way to do this, and at first I was a little confused as to how I could reach this information. It turns out that this can be read from the incoming stream to PHP, php://input.

Pulling from that stream gave her the raw data she needed (nicely urlencoded too) that she could parse out and use. She includes a simple example that has a check for the REQUEST_TYPE in the _SERVER superglobal to see how the request should be handled (PUT versus GET).

0 comments voice your opinion now!
put get data incoming rest webservice stream input


blog comments powered by Disqus

Similar Posts

Jani Hartikainen's Blog: The three types of programmers

NETTUTS.com: Can You Hack Your Own Site? A Look at Some Essential Security Considerations

Lorna Mitchell's Blog: Accessing Incoming PUT Data from PHP

Roshan Bhattarai's Blog: How to filter user submitted data easily in PHP?

IBM developerWorks: Hook into Wikipedia information using PHP and the MediaWiki API


Community Events

Don't see your event here?
Let us know!


release api install interview introduction community symfony2 library extension podcast framework series example version laravel conference voicesoftheelephpant performance php7 opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework