

There are three versions of HTTP: 0.9, 1.0, and 1.1. In this chapter, we talk about each of the commonly used client request methods, and show you examples of their use. Although the most common request method is the GET method, there is also a handful of other methods that are supported by HTTP, and essentially define the scope and purpose of the transaction. Here we use the GET method to request the document /index.html using version 1.0 of HTTP. Then it sends a document request by specifying an HTTP command (called a method), followed by a document address and an HTTP version number. First, the client contacts the server at a designated port number (by default, 80).The client initiates the transaction as follows: HTTP is a simple stateless protocol, in which the client makes a request, the server responds, and the transaction is then finished. Structure of an HTTP TransactionĪll HTTP transactions follow the same general format, as shown in Figure 3-1. Although a few key phrases will help you get around town, fluency becomes very useful when you find yourself lost in the outskirts of the city. But it's all information you should know, so we recommend that you keep coming back to it. Furthermore, if you use LWP, then you can go pretty far without knowing more than a superficial amount of HTTP. This is one of the longest chapters in this book, and no doubt you won't read it all in one sitting. Headers give clients the opportunity to declare who they are and what they want, and they give servers the chance to tell clients what to expect.


#Http client online software#
For the most part, all web software will use an exchange similar to the HTTP we showed you in Chapter 2, Demystifying the Browser. In the previous chapter, we went through a few examples of HTTP transactions and outlined the structure that all HTTP follows. This book is out of print, but it has been made available Web Client Programming with Perl Automating Tasks on the Web Web Client Programming with Perl: Chapter 3: Learning HTTP
