204 no content 304 not modified 400 bad request 401 unauthorized 403 forbidden 404 not found 405 method not allowed 409 conflict 410 gone 415 unsupported media type 418 i’m a teapot 422 Unprocessable entity 429 too many requests 500 internal error
for relationships and data structures every response must be a document or a collection of documents standard names for common fields mandatory links to schema and self JSON: jsonspec http://jsonspec.org
< VersionController ... def index @comments = @talk.comments.chronologically.page(params[:page]) respond_with @comments, status: 200, serializer: PaginationSerializer end ... end end end app/controllers/api/v1/comments_controller.rb
under CC BY 3.0 Bibliography: “How to Design a REST API and Why You Should” (http://goo.gl/Ms85sU) “When crafting your API strategy, put design first” (http://goo.gl/N1OnPT) “Best Practices for Designing a Pragmatic RESTful API” (http://goo.gl/1yTjC) “HTTP API Design Guide” (http://goo.gl/slrurt) Code School (http://codeschool.com) Faces made with