Dec
2
As a programmer, we implement complex solutions with complex technology but miss some basic knowledge of web protocols.
- TCP / IP is state-full and session oriented connection: TCP / IP is the most commonly used internet protocol, also called Internet Protocol Suite. When we open a Telnet session from a laptop to a Linux server, we initiate a persistent connection – the connection is persistent in that a connection between our laptop and Linux server is established at the very beginning of the telnet, and is never torn down unless the telnet session is terminated.
- HTTP is stateless by design and not connection persistent – although, HTTP 1.1 protocol enhances and improves on the previous version by keeping established connections alive using Keep-alive messages – all of that is handled by our favorite web browsers under the covers.
- Common HTTP response codes:
| Response Codes | Description |
| 200 | Success; response header “Content-type” will elaborate on the content type mime-type (such as text/html, application/pdf etc.) Response body will contain the appropriate content |
| 404 | Resource not found; no such resource found; URL contains an invalid path value |
| 500 | Internal Server Error; request could not be understood |
| 302 | Page has been moved; response header will contain the new location of the page in a separate “Location” header |
| 304 | File not changed since; this response is sent back to a web browser when a conditional request was made by the browser in the form of “If Modified since” in the request header. |