phenotypical

phenotypical

Feb 28 / 7:08am

REST's fifth HTTP method: PATCH?

The HTTP method PUT means resource creation or replacement at some given URL.

Think files, for example. If you upload a file to S3 at some URL, you want either to create the file at that URL or replace an existing file if there's one. That is PUT.

Now let's say a web application has an Invoice model with a paid flag that indicates whether the invoice has been paid. How do you set that flag in a RESTful way? Submitting paid=1 via PUT to /invoices/:id does not conform to the semantics, because such request would not be sending a complete representation of the invoice for replacement.

...

In practice, as you see, PATCH suits everyday web programming way better than PUT for updating resources. In Ruby on Rails it corresponds naturally to the way we use update_attributes for updating records.

Thus, PATCH is going to be the primary method for updates in Rails 4.0.

Filed under  //  REST  
Jan 10 / 10:47am

Library of Congress Prints & Photos Goes JSON

The Library of Congress' recently re-released Print & Photographs Online Catalog (http://www.loc.gov/pictures/) provides a json serialization of the request-scoped state used to create every html page.  This immediately enables PPOC to serve as a simple API for developers to make use of while building other applications, integrating Library data in new and innovative ways.

Filed under  //  Gov 2.0 / Transparency / Civic Stack   REST   api's  
Apr 8 / 4:57pm

The Fitbit Public API has arrived.

Media_httpwwwfitbitco_yseyd

Fitbit is more than just a gadget - it’s a platform for wellness and awareness. Tracking steps, activities, food, sleep and a whole range of attributes about your life allows insights into how you can change your life and improve your well-being.  But so far you’ve been limited to using Fitbit’s website for what you can do with that data.  Well today all that changes.

 

Filed under  //  REST   api's   gadgets   health  
Nov 30 / 8:12am

Web Services Org Folds Up and the REST is History

Remember all the WS-* specifications that had garnered significant traction in the last decade among major software vendors? It seems that we might have seen the last of them. The Web Services Interoperability Organization (WS-I) recently announced that they had completed their work.

Filed under  //  REST  
Nov 16 / 2:43pm

New directions in web architecture. Again. - O'Reilly Radar

Although it has been a long time coming, we're finally finishing the revolution that started with Ajax. Get data that users care about, make it available via an API, provide a data presence that's distinct from your HTML-based web presence, and build multiple front ends to serve your customers, on whatever platforms they care about. Your value is in the data.

Filed under  //  Ajax   JavaScript   REST   Twitter  
Oct 4 / 3:30pm

Outstanding preso on building a RESTful API in CFML using Mach-II

Doug Smith gave an excellent presentation the other day on the cfmeetup on building a RESTful API in CFML, using the Mach-II framework.  Really worth watching.  Note Peter Farrell followed up with some expanded answers to some of the questions that came up.  Can't wait to start using this in my next app!

Screen_shot_2010-10-04_at_1

Filed under  //  Mach-II   REST   coldfusion / cfml