 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Reddit.com: Year Old Bug Request for $_PUT Interested in /r/php's Opinion
by Chris Cornutt October 23, 2012 @ 09:48:12
A discussion has started up on Reddit.com about the request for a "$_PUT" superglobal to match the already existing "$_POST" and "$_GET" (as is mentioned in this bug).
Data that is posted to PHP via the PUT method is not parsed at all and is not
available to PHP. This is particularly problematic for data sent encoded as 'multipart/form-data'. [...] This is something that would help every RESTful interface that people are trying to do with PHP. There are many people who have these problems and have to implement (usually incomplete and/or buggy) PHP solutions.
In the Reddit post there's a mixed set of opinions - some say that things work well enough as is (content pulled from the raw stream) and others say that adding something like this makes the HTTP support more complete and functional.
voice your opinion now!
rest put http method support superglobal
PHPMaster.com: REST - Can You do More than Spell It? Part 1
by Chris Cornutt April 30, 2012 @ 09:51:46
On the PHPMaster.com site there's a recent tutorial posted, the first part in a series of posts from David Shirey about building REST APIs in PHP. This first part of the series stays pretty high-level and really just introduces some common REST concepts.
Thousands of years ago when we first started building web pages, things were very simple. You'd put some text on the page, maybe even an image, and that was pretty much it. But today it's a whole different ball game. Instead of static pages there's the dynamic applications we've come to depend on. And so, how these applications are designed to communicate becomes very important. In this series I'll introduce you to the REST architecture style. In this article I'll help you to understand exactly what it is, and later I'll show you how it can be implemented in a PHP environment.
He defines the term "REST" for those not familiar and how a typical RESTful API allows other end users/software to interact directly with its data. He outlines some of the common principles of REST and finishes the post with a comparison of two HTTP verbs - PUT and POST.
voice your opinion now!
rest api webservice introduction put post
Lorna Mitchell's Blog: Adding PUT variables to Request Object in Zend Framework
by Chris Cornutt August 17, 2009 @ 09:48:05
Lorna Mitchell has added a new post to her blog about adding in PUT variables to your Zend Framework Zend_Request object (useful for web services).
Its very simple: I have extended Zend_Controller_Action with my own, and all controllers inherit from here. This has a routeAction() which grabs the incoming variables from a PUT request and sets them as parameters within the usual $this->getRequest() scope, then forwards on the request.
Her example adds a call to the isPut method to check for the PUT request type and, if found, takes in the request values and pushes them back into the action's parameter values. Then the controller can make a call back to the request object to pull in the parameters when needed.
voice your opinion now!
put zendframework request object
Ian Selby's Blog: Making RESTful Requests in PHP
by Chris Cornutt May 15, 2009 @ 07:57:19
In a new post to his blog Ian Selby looks at working with REST requests in PHP. He includes some of the basics of REST too, for those not completely familiar with the term.
APIs have become a very commonplace part of many popular web sites and services...especially REST APIs. I've already discussed how you can roll your own REST API for your PHP apps, but I've also received countless requests to go over how to actually make RESTful requests. That's exactly what we'll take a look at in this article
His tool of choice is the curl extension, making it simple to create a class wrapper with methods like executePost, executeGet, setAuth and, of course, execute. He outlines the class and gives the code blocks that fit inside each of the major functions. In the end you'll have a class that can make GET, POST, PUT and DELETE requests and be able to correctly parse the response.
voice your opinion now!
delete post put get tutorial request rest
Kris Jordan's Blog: Towards RESTful PHP - 5 Basic Tips
by Chris Cornutt December 10, 2008 @ 12:08:27
Kris Jordan recently posted five tips to help you get a "more correct" REST interface in your application.
As we entered a programmable web of applications with APIs the decision to ignore HTTP gave us problems we're still dealing with today. We have an internet full of applications with different interfaces (GET /user/1/delete vs. POST /user/delete {id=1}). With REST we can say /user/1 is a resource and use the HTTP DELETE verb to delete it.
Here's the five (six?) tips:
- Using PUT and DELETE methods
- Send Custom HTTP/1.1 Headers
- Send Meaningful HTTP Headers
- Don't Use $_SESSION
- Test with cURL or rest-client
- Use a RESTful PHP Framework
voice your opinion now!
restful rest tip put delete custom header session curl framework
Lorna Mitchell's Blog: Accessing Incoming PUT Data from PHP
by Chris Cornutt 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).
voice your opinion now!
put get data incoming rest webservice stream input
Ben Ramsey's Blog: Supporting PUT & DELETE in the Zend Framework
by Chris Cornutt February 28, 2008 @ 10:27:00
Ben Ramsey has recently blogged about some of the research and bit of development that he's done to add "more correct" functionality to the Zend Framework for working with RESTful interfaces - proper PUT and DELETE support.
I've recently been wrapped up in an effort to design and implement a RESTful API using the Atom Protocol for a project at work. We are using the Zend Framework as the underlying framework for the project, so, in order to follow the Atom Protocol, I needed to support the HTTP methods PUT and DELETE
Since the Zend Framework has been playing such a prominent role in the development, he's been digging into the Zend_Rest_Server component code and isn't too happy about its support for PUT and DELETE. As a result, he's proposed methods that might help resolve things such as isGet, isDelete, isOptions and getEntityBody. He' even created a patch to make the needed changes.
voice your opinion now!
rest interface zendframework put get delete patch
|
Community Events
Don't see your event here? Let us know!
|