News Feed
Jobs Feed
Sections




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

Lorna Mitchell:
Are Subqueries RESTful?
June 13, 2013 @ 10:41:14

In this new post to her site Lorna Mitchell tries to help answer a question she got on Twitter about "subqueries" in REST API calls. In this case, a subquery is requesting just a subset of the data from a resource.

REST is all about representations of resources. They might come in different formats, and they might appear at their own URI as well as in one or more collections, but essentially you just get a representation of a thing. This is great, apart from when it isn't. [...] There are a couple of tactics that I deploy each time I need to solve one of these problems, but they all revolve around remodelling the resource structure. Just as we sometimes move fields around for database design or normalisation, we can do exactly the same with a RESTful service to make the resulting output make more sense to consumers.

She talks about one method that lets the consumer change the "verbosity" of the response and another that splits these pieces out into separate sub-resources for each section. She suggests a third option as well, the nesting of likely data - that is related data the user might most likely want along with what they requested.

0 comments voice your opinion now!
rest api subquery verbosity subresource likely data

Link: http://www.lornajane.net/posts/2013/are-subqueries-restful

blog comments powered by Disqus

Similar Posts

Jeremry Johnstone's Blog: PHP interface to Picasa Web Albums

Gonzalo Ayuso: Building a Silex application from one Behat/Gherkin feature file

Dave Marshall's Blog: How I'm designing a RESTful(ish) web service

Lorna Mitchell's Blog: Tips on Writing an API for a Smartphone App

Brian Swan's Blog: Using SQL Azure to Store PHP Session Data


Community Events











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


database framework security unittest symfony2 release introduction hack language hhvm component package composer performance project application example install podcast facebook

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