The following partial example shows how HTTP requests can be read with
async_chat. A web server might create an http_request_handler object for
each incoming client connection. Notice that initially the
channel terminator is set to match the blank line at the end of the HTTP
headers, and a flag indicates that the headers are being read.
Once the headers have been read, if the request is of type POST
(indicating that further data are present in the input stream) then the
Content-Length: header is used to set a numeric terminator to
read the right amount of data from the channel.
The handle_request() method is called once all relevant input
has been marshalled, after setting the channel terminator to None
to ensure that any extraneous data sent by the web client are ignored.