https://www.padok.fr/ https://www.padok.fr/en/blog https://www.padok.fr/en/blog/tag/technology https://www.padok.fr/en/blog/http-request This article does not replace a real network course and for the sake of simplification, it may contain some inaccuracies.

We can see that the first thing to do to make an HTTP request is to open a socket!

Sending the HTTP Request # client.py import socket socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket.connect(("www.google.com", 80)) request = b'GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n' socket.sendall(request)

Just like an HTTP request has headers and content, a TCP packet also has headers and content.

Related Articles