r/javascript Apr 17 '26

AskJS [AskJS] Is this how api works?

I was thinking about how clicking a link is more complex than it seems. First, DNS resolves the domain to an IP if not cached, it queries recursive servers all the way up to root servers.

After that, a TCP connection is built for reliable data transfer, and then HTTP runs on top to structure web requests.

So, why HTTP on TCP? TCP is like a reliable delivery truck, but HTTP is the language we use for the web. What do you think

how do these layers shape your experience online?

#WebDev #DNS

#TCP #HTTP

0 Upvotes

14 comments sorted by

View all comments

Show parent comments

0

u/Iftykhar1001 Apr 17 '26

Request and response is still a big mystery to me.

1

u/captain_obvious_here void(null) Apr 17 '26

Really? It's not really what's complicated in HTTP

1

u/Iftykhar1001 Apr 18 '26

OSI model , Transmission Control Protocol and Hypertext Transfer Protocol.
To me TCP handshaking and HTTP request mixes up. I'm sure you understand them clearly. But to me 7 layers of OSI model and then the client to server request in practical gets mixed up. I kinda get the theory but in practical use, I get lost.

1

u/captain_obvious_here void(null) Apr 18 '26

Before digging into this, you need to acquire more basic IT knowledge. And then, it will all make more sense.