What is HTTP?
I like to think that HTTP is the Internet's Web Information Delivery System. But if you prefer the official name, it stands for HyperText Transfer Protocol π More on protocols here:
But basically, HTTP helps information go around the internet because it defines defines the ways in which requests to servers and responses from servers should be written.
How does an HTTP request look like?
HTTP is a little bit like the delivery system of the internet.
Just like mailing addresses follow a format that mail companies understand:
HTTP requests and responses have their own format.
HTTP requests look like this:
and HTTP responses from a server look like this:
Depending on the nature of the request there will be different headers involved.
Browser does all of this for you in the background! It composes the HTTP messages for you.
HTTP apis. Protocols must be implemented...
For every single resource that you load from a server (pretty much anytime you do something on the internet) an HTTP request is created!
You might be thinking "How's that even possible? I never wrote an HTTP in my life." That's true, but it doesn't mean requests haven't been written for you! Your browser composes HTTP requests and handles HTTP responses in the background for you as you surf the web!
How does an HTTP request look like?
What does, " HTTP is stateless mean?"
Problem: Stateless HTTP
HTTP is stateless by default. It's just a protocol used to send and receive information.
HTTP is like a mailman that just delivers things based on the information on the package.
Do mailmen care that the package you're delivering is to your grandma in Wisconsin? Nope, they'll just deliver your package and get going.
They don't know anything about your relationship with the people sending to and receiving packages from you.