HttpRequest class

A server-side object
that contains the content of and information about an HTTP request.

Note: Check out the
http_server
package, which makes working with the low-level
dart:io HTTP server subsystem easier.

HttpRequest objects are generated by an HttpServer,
which listens for HTTP requests on a specific host and port.
For each request received, the HttpServer, which is a Stream,
generates an HttpRequest object and adds it to the stream.

An HttpRequest object delivers the body content of the request
as a stream of byte lists.
The object also contains information about the request,
such as the method, URI, and headers.

In the following code, an HttpServer listens
for HTTP requests. When the server receives a request,
it uses the HttpRequest object's method property to dispatch requests.

An HttpRequest object provides access to the associated HttpResponse
object through the response property.
The server writes its response to the body of the HttpResponse object.
For example, here's a function that responds to a request: