O'Reilly logo

Programming Social Applications by Jonathan LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HTTP Response Status Codes

When you’re working with web services and the APIs of companies whose data you would like to use, it is important to understand the method these services use to communicate with you—HTTP response status codes.

When issuing requests to these services, you may receive any number of responses back in different address ranges. These codes will help you determine whether there were any major issues, if there was something expected by the service that was not present in the request, or if everything was sent and processed successfully.

In the response structure that a service sends back, you should be able to extract the HTTP response, which generally comprises the response code and a description that explains it.

There is a vast number of possible response codes, but the address ranges that will be returned will allow you to pinpoint any issues or decide whether you can process the response as a success case. These ranges include:

1xx range

The request has been received and processing is in progress.

2xx range

The request has been received, understood, accepted, and processed successfully.

3xx range

The request has been received, but the client needs to take additional actions to complete the request.

4xx range

There was an error in the request sent by the client. The response from the server should indicate the specific issue encountered.

5xx range

The request was received and appears to be valid, but an error occurred while the server was attempting to process it.

Understanding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required