What is HTTP? (HyperText Transfer Protocol)
According to Wikipedia, The Hypertext Transfer Protocol (HTTP) is an application layer protocol for distributed, collaborative, hypermedia information systems.
HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser.
HTTP is what’s used whenever you view a website, developed by Tim Berners-Lee and his team between 1989-1991. HTTP is the set of rules used for communicating with web servers for the transmitting of webpage data, whether that is HTML, Images, Videos, etc.
What is HTTPS? (HyperText Transfer Protocol Secure)
HTTPS is the secure version of HTTP.
HTTPS data is encrypted so it not only stops people from seeing the data you are receiving and sending, but it also gives you assurances that you’re talking to the correct web server and not something impersonating it.
HTTP Methods
Table of Contents
- GET
- POST
- PUT
- HEAD
- DELETE
- PATCH
- OPTIONS
HTTP methods are a way for the client to show their intended action when making an HTTP request.
GET –>
GET is used to request data from a specified resource.
GET is one of the most common HTTP methods.
POST Request
POST is used to send data to a server to create and have the capability to update a resource.
PUT Request
This is used for submitting data to a web server to update information
HEAD Request
HEAD is almost identical to GET, but without the response body.
DELETE Request
This is used for deleting information/records from a web server.
HTTP Status Codes:
Find a list of status codes and its uses >> HTTP Status response codes
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
- Informational responses (
100
–199
) - Successful responses (
200
–299
) - Redirects (
300
–399
) - Client errors (
400
–499
) - Server errors (
500
–599
)
Source : Moziila developers
Headers
A header is an extra bit of data that can be sent to the web server when making a request.
Headers are not strictly required when making HTTP requests, but sometimes it is difficult to properly display a website.
Headers can be grouped according to context.
The request header contains detailed information about the resource to fetch or the client requesting the resource.
The response header holds additional information about the response, such as the location of the response or the server serving it.
The representation header contains information about the body of the resource, such as MIME type and applied encoding/compression.
The payload header contains representation-independent information about the payload data, such as the length of the content and the encoding used for transmission.
Cookies:
These are nothing but a piece of data stored in the computer
When the “SetCookie” header is received from the web server, a cookie is stored. Then, each time you make a further request, cookie data is sent to the web server. Because HTTP is connectionless (it doesn’t track previous requests), cookies can be used to tell the web server whether a user’s website is personal or previously accessible.