Everything about HTTP
Details about HTTP, Port Number, Status Codes, Request Methods, and Headers
What is HTTP?
- HTTP is a hypertext transfer protocol.
- HTTP is basically built on
TCP(Transmission Control Protocol). TCP is a lower-level protocol that handles other lower-level important stuff that HTTP does not have to worry about.
4XX- Client Error (like
404 NOT FOUND), Here the client is responsible for the error.
5XX- Server Error (like
503 Server Not Available), Here server is responsible for the error.
httpwe also have
sshetc which have some port number assigned to it.
- It is mainly done to distinguish between all these, as when we will search for something then how our computer will know whether to use
Port Number assigned:-
ftpstands for File Transfer Protocol.
sshstands for Secure Server Protocol.
- When we will search for
https://google.comthen by default, the search will be for
- By all these ports it doesn’t mean that
httpswill not work with the port number
234, it will work but it is not what anyone will advise someone to do.
More about Port Numbers
- Port numbers are not infinite. They are finite and they range from 0 to 65535. That simply means we cannot start any port number great than 65535.
- Port numbers below 1023 are privileged port numbers. They require certain administrative access to be opened.
GETmethod is the default request method.
- Mostly we do use
GETmethods to browse most of the web.
GETbasically means that you are visiting web pages.
POSTmeans you want to interact or send some data to the server.
POSTis used to communicate data to the server.
PUT- Its functionality is the same as that of
POSTbut if we will use
POSTthen our server and client both know that we want to create the resource.
PATCHmeans to edit the resource.
DELETEmeans to delete a particular resource.
GETis the method should not have a body as if it will store some data like username, and password then anyone can access those data via just visiting the site.
- We can do anything we want using
POSTon the internet under
http. These two are the most powerful methods to use.
- Functionality wise
POSTis the most superior as it can perform as others as well. Because
Request Payloadbody which contains the resources.
- HTTP headers are just a way to provide more information to the request.
- For example
Content-Type: text/html, this content-type header simply tells which type of content we have.
Full View of the Request Header
accept-encoding: gzip, deflate, br
cookie: _gcl_au=1.1.659405939.1664042912; _ga=GA1.1.1679921718.1664042913; _fbp=fb.1.1664042912877.1560911668; AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImR1a2U3ODYiLCJfaWQiOiI2MTFjYTUyYzQxYzRhMTAwMDhlNDg4M2QiLCJuYW1lIjoiTW9oaXQgTWlzaHJhIiwiaWF0IjoxNjY0MDQzODM1LCJleHAiOjE2NjkyMjc4MzV9.uzly7qoYubm5iW-vok9M4c7kKG-Qd3HZ6YPKVKQSy4k; amp_824c80=XqiaBPuVfqgshtUxKQWhWe...1ge1rdkrm.1ge1rdkrm.1.2.3; _clck=1drazbx|1|f59|0; crisp-client%2Fsession%2F3e9d1351-f1a3-4320-986d-a97e915064bd=session_b9678a0f-dd6f-4726-95d0-fbbd9d6f8f9f; _clsk=o2x2c1|1664372093460|10|1|n.clarity.ms/collect; _ga_5Q1YFB1R0F=GS1.1.1664372054.10.1.1664372095.0.0.0; amp_824c80_codedamn.com=XqiaBPuVfqgshtUxKQWhWe.NjExY2E1MmM0MWM0YTEwMDA4ZTQ4ODNk..1ge24s6mj.1ge24teib.26.e.2k
sec-ch-ua: "Google Chrome";v="105", "Not)A;Brand";v="8", "Chromium";v="105"
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/22.214.171.124 Safari/537.36
Firstly, know that:
- URLs are a type of URI
- URNs are a type of URI
- URCs are a type of URI
and there are many other
- A standard for identifying documents using a short string of numbers, letters, and symbols.
- Defined by
Examples:- URLs, URNs, URCs, and many others.
- Contains information about how to fetch a resource from its location.
- Always start with the protocol
- Can be relative
- Identifies a resource by a unique and persistent name, but doesn’t necessarily tell you how to locate it on the internet.
- It usually starts with the prefix urn:
urn:isbn:0451450523to identify a book by its ISBN number.
urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66a globally unique identifier
- Points to metadata about a document rather than to the document itself.
- An example of a URC is one that points to the HTML source code of a page
- Examples:- like: