Discussion: Published standards for REST response formats

Events happening in the community are now at Drupal community events on www.drupal.org.
Crell's picture

There's a budding discussion in the WSCCI and Services groups about a Drupal-wide consistent standard for how to respond to REST requests. (When should use we a 403 vs. 404 vs. 406 vs. returning a 200 with a 0 as the only value, etc.) Right now Services.module-related code is very inconsistent. That should be made consistent both for Services and for Drupal 8 with the WSCCI initiative. What should that standard be? Discuss. :-)

Comments

How others define service status codes

kevee's picture

For discussion, here's a few status code definitions of well-used APIs out there:

Google's Data API has a good list:
http://code.google.com/apis/gdata/docs/2.0/reference.html#HTTPStatusCodes

Ditto for the Twitter API:
https://dev.twitter.com/docs/error-codes-responses

Posterous uses the often-forgotten 422 code for validation errors:
http://posterous.com/api/docs/pages/overview

REST & WOA

robloach's picture

The REST & WOA Wiki has some pretty awesome docs on what seems quite appropriate:
http://restpatterns.org/HTTP_Status_Codes

No comments

Crell's picture

Sorry, we didn't get comments turned off in time in this thread. Do not post anything here. Go post in the linked discussion thread. Thanks.

Core

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: