Skip to main content

Posts

Showing posts with the label Web

Proper REST Status Code

Finding the proper REST response code can be painful sometimes when designing REST API, because The list of HTTP status code is (unnecessary) long (75 for now on wiki ). Too many possible status codes for a REST API make the API harder to be consumed by clients, whereas too few status codes do not provide enough granularity for errors. We all use 200 OK, but how often do we use the following? 205 Reset Content 300 Multiple Choices 419 Authentication Timeout This article discusses what is the proper code subset that are frequently used and well-understood, and still provide enough granularity of errors. Steve Marx from Dropbox has a nice article talking about “ How many HTTP status codes should your API use? ”. In short, the Twitter documents 15 status codes . Dropbox uses 8 specific status codes . For error code, it is common to provide a detailed error message or specific error code in JSON response. Before I begin, here are some nice sites about this...