News Feed
Sections




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

Matthew Weier O'Phinney:
RESTful APIs with ZF2, Part 2
February 14, 2013 @ 09:15:06

Matthew Weier O'Phinney has posted the second part of his series looking at creating RESTful APIs with the Zend Framework v2. In the previous post he covered some of the basics of data and structure. In this new article he looks at content types, status codes and two ways to represent them back to your users.

In my last post, I covered some background on REST and the Richardson Maturity Model, and some emerging standards around hypermedia APIs in JSON; in particular, I outlined aspects of Hypermedia Application Language (HAL), and how it can be used to define a generic structure for JSON resources. In this post, I cover an aspect of RESTful APIs that's often overlooked: reporting problems.

He starts with some of the things around error handling and APIs that bother him and why just returning a status code representing an error isn't enough. He suggests two possible solutions to this issue - two messaging formats, API-Problem and vnd.error. He gives brief summaries of each and includes example output to give them some context.

0 comments voice your opinion now!
zendframework2 rest api tutorial series error handling apiproblem vnderror


blog comments powered by Disqus

Similar Posts

Conor Mac Aoidh's Blog: OS X: Audio Alerts for PHP Errors

Sudheer Satyanarayana's Blog: A Bit Of XML, RSS And CURL In 7 Lines Of PHP And A Useful Program

Sameer Borate's Blog: Templating with Haml

NetTuts.com: Build Web Apps from Scratch with Laravel - The Eloquent ORM

Vid Luther's Blog: Using your Mac as a local web development environment.


Community Events





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


security interview podcast list tool composer voicesoftheelephpant release language laravel symfony framework artisanfiles version opinion series conference introduction library community

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