Skip to main content

HTTP protocol - The Basics

The Basics of HTTP Protocol - introduction for beginners.

HTTP (Hypertext Transfer Protocol) is the foundation of data communication on the web. It defines the rules and formats for messages exchanged between a web server and a client (usually a web browser).

Here are some fundamental aspects of HTTP

HTTP Methods (HTTP Verbs)

GET

Used to request data from a specified resource. It should only retrieve data and should not have any other effect on the server.

POST

Used to submit data to be processed to a specified resource. It can result in the creation of a new resource or an update of an existing one.

PUT

Used to update a resource or create a new resource if it doesn't exist at the specified URL.

DELETE

Used to request the removal of a resource identified by the URL.

HTTP Status Codes

HTTP status codes are three-digit numbers returned by the server to indicate the outcome of the HTTP request. Here are some common ones:

  • 200 OK: The request was successful, and the server has returned the requested data.
  • 201 Created: The request has resulted in the creation of a new resource.
  • 204 No Content: The request was successful, but there is no additional data to return.
  • 400 Bad Request: The request was malformed or invalid.
  • 401 Unauthorized: Authentication is required or has failed.
  • 403 Forbidden: The client does not have permission to access the requested resource.
  • 404 Not Found: The requested resource could not be found on the server.
  • 500 Internal Server Error: A generic error message indicating a problem on the server.

✅ In Summary

Understanding these basics is crucial for web development, including working with Django, Flask, NodeJS and all other modern frameworks.

You'll often use the GET and POST methods to retrieve and submit data, and you'll handle different HTTP status codes to respond to various situations.

✅ Resources