Learning Python Network Programming

(Sean Pound) #1

Programming with Sockets


As you can see, the HTTP GET request has other components such as Request URI,
version, and so on. Now you can check the HTTP response from the web server
to your client. It has come after the TCP acknowledgment packet, that is, the sixth
packet. Here, the server typically sends an HTTP response code (in this case 200 ),
content length, and the data or web page content. The structure of this packet is
shown in the following screenshot:


From the preceding analysis of the interaction between the client and server, you can
now understand, at a basic level, what happens behind the scenes when you visit
a web page using your web browser. In the next section, you will be shown how to
create your own TCP server and examine the interactions between your personal
TCP client and server.

Free download pdf