chickadee » intarweb » read-request

read-request PORTprocedure

Reads a request object from the given input-port. An optional request body can be read from the request-port after calling this procedure.

If an end of file is returned before anything can be read (when the connection was closed by the remote end before it sent the request), #f is returned. In case of an invalid HTTP request line, an exception of type (exn http unknown-protocol-line) is raised.

NOTE: Currently, CONNECT-type requests which have an "authority" (hostname) between the method and the protocol version are not recognised and will result in an unrecognised protol line error. This is a limitation of intarweb.

Requests with an asterisk (like OPTIONS * HTTP/1.1) will cause #f to appear in the request object's uri slot.