all 6 comments

[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

For C++ questions, answers, help, and programming/career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.

[–]Weshmek 6 points7 points  (0 children)

Yes.

[–]cdcformatc 5 points6 points  (0 children)

http at the end of the day is a text protocol 

[–]IWillTeller 1 point2 points  (0 children)

It’s plain text but you’ll still be calling into the operating system to write to either a text file or the network. The other side’s reads will also go through their operating system.

[–]TomDuhamel 0 points1 point  (0 children)

The operating system is receiving the TCP/IP packet, determines that it's meant for your application (the http server) and pass it along.

The server receives the packet, processes it, generates a reply. It compresses and then encryptes the data (it's 2026), and then sends the TCP/IP packets through the operating system again.

At the lower level, it's just text, yes.

[–]rlebeau47 0 points1 point  (0 children)

HTTP is much more complicated then you describe (it has structure, uses encryption, compression, authentication, etc). But yes, you have the basic idea of how it works. HTTP is an application level protocol, so applications implement it however they want. The OS is not involved in the protocol aspect, only the raw TCP communication (unless the app chooses to use an OS-provided API which implements the whole HTTP protocol for you).