ABSTRACT

Almost everything on the web communicates via the HyperText Transfer Protocol (HTTP). The core of HTTP is a request/response cycle that specifies the kinds of requests applications can make of servers, how they exchange data, and so on. An HTTP request is just a block of text with two important parts: The method is almost always either GET or POST. The URL is typically a path to a file, but as we’ll see below, it’s completely up to the server to interpret it. Unlike a dictionary, a key may appear any number of times, which allows a request to do things like specify that it’s willing to accept several types of content. The body of the request is any extra data associated with it, such as files that are being uploaded. If a body is present, the request must contain the Content-Length header so that the server knows how much data to read.