This library provides the core of the implementation of the HTTP
protocol at the server side and is mainly intended for internal use.
It is used by
Still, it provides a few predicates that are occasinally useful for applications:
- http_current_request/1 finds the current request for occasional usage in places where it is not avaialable otherwise.
- http_peer/2 finds the (IP4) peer address, getting the original
address if we are behind a proxy (
- http_relative_path/2 can be used to find a relative path from the current request.
- http_wrapper(:Goal, +In, +Out, -Close, +Options) is det
- Simple wrapper to read and decode an HTTP header from `In', call
:Goal while watching for exceptions and send the result to the
The goal is assumed to write the reply to
current_outputpreceeded by an HTTP header, closed by a blank line. The header must contain a Content-type: <type> line. It may optionally contain a line
Transfer-encoding: chunkedto request chunked encoding.
- Return the full request to the caller
- IP address of client
The following predicates are exported, but not or incorrectly documented.