Client-Server Communication: Request-Response Cycle
At the heart of web-based client/server communications is the HTTP request-response cycle. A client sends a request to the server, and the server returns a response to the client.
Clients can send different types of requests. The two most common request methods are GET and POST.
The HTTP GET method is simpler and, when using a web browser client, the request displays what’s being sent in the web browser URL address bar. The POST method can hide much of what is being sent in the body of the request message.
Response Status Codes
At the beginning of every HTTP response returned by the server is a three-digit HTTP status code that tells the client the status of the server’s attempt to process the request. The most common codes are 200 OK to indicate that a request has been successfully fulfilled and 404 Not Found to indicate that the server was unable to find the requested resource. The first digit of the code indicates the general status of the server’s interpretation and processing of the request.
- 1: Information
- 2: Success
- 3: Redirection
- 4: Client Error
- 5: Server Error
Inspection of Headers
In Google Chrome, open Developer Tools (right click and then Inspect). Click on the "Network" tab and reload the page. Find the Name column on the left of the developer window, locate the first file, which should be the Url, and click it. Click "Headers" to see the HTTP headers - General, Response Headers and Request Headers.