The HTTP protocol is nearly stateless: a user agent (or browser) makes a request and the server provides a response. For services that don't involve cookies, a client application can take a functional view of the protocol. We can build a client using the
urllib library. An HTTP user agent essentially executes something similar to the following:
import urllib.request def urllib_demo(url): with urllib.request.urlopen(url) as response: print(response.read()) urllib_demo("http://slott-softwarearchitect.blogspot.com")
A program like wget or curl does this kind of processing using a URL supplied as a command-line argument. A browser does this in response to the user pointing and clicking; the URL is taken from the user's actions, often the action of clicking on linked text or images.
The practical considerations of user-experience (UX) design, however, lead to some implementation details that are stateful. When a client is obliged to track...