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:
The request has been received and processing is in progress.
The request has been received, understood, accepted, and processed successfully.
The request has been received, but the client needs to take additional actions to complete the request.
There was an error in the request sent by the client. The response from the server should indicate the specific issue encountered.
The request was received and appears to be valid, but an error occurred while the server was attempting to process it.