Application layer protocols rely on underlying transport layer protocols called UDP (User Datagram Protocol) and TCP (Transmission Control Protocol).
For now, all you need to know is that TCP ensures that messages are always delivered. Messages get delivered in the order that they are sent.
UDP does not ensure that messages get delivered. This means that some messages may get dropped and so never be received.
HTTP uses TCP as its underlying transport protocol so that messages are guaranteed to get delivered in order. This allows the application to function without having to build any extra reliability as it would’ve had to with UDP.
This sort of reliance on other layers for certain jobs is one of the key advantages of a layered architecture!
TCP is connection-oriented, meaning a connection has to be initiated with servers using a series of starting messages.
Once the connection has been made, the client exchanges messages with the server until the connection is officially closed by sending a few ending messages.