mod_esi
Erlang Server Interface
- Provided by: erlang-manpages (Version: 1:18.3-dfsg-1ubuntu3.1)
- Source: erlang
- Report a bug
Erlang Server Interface
This module defines the Erlang Server Interface (ESI) API. It is a more efficient way of writing Erlang scripts for your Inets web server than writing them as common CGI scripts.
deliver(SessionID, Data) -> ok | {error, Reason}
Types:
This function is only intended to be used from functions called by the Erl Scheme interface to deliver parts of the content to the user.
Sends data from an Erl Scheme script back to the client.
Module:Function(SessionID, Env, Input)-> _
Types:
Module must be found in the code path and export Function with an arity of three. An erlScriptAlias must also be set up in the configuration file for the web server.
If the HTTP request is a 'post' request and a body is sent, content_length is the length of the posted data. If 'get' is used, query_string is the data after ? in the URL.
ParsedHeader is the HTTP request as a key-value tuple list. The keys in ParsedHeader are in lower case.
SessionID is an identifier the server uses when deliver/2 is called. Do not assume anything about the datatype.
Use this callback function to generate dynamic web content dynamically. When a part of the page is generated, send the data back to the client through deliver/2. Notice that the first chunk of data sent to the client must at least contain all HTTP header fields that the response will generate. If the first chunk does not contain the end of HTTP header, that is, "\r\n\r\n", the server assumes that no HTTP header fields will be generated.
Module:Function(Env, Input)-> Response
Types:
This callback format consumes much memory, as the whole response must be generated before it is sent to the user. This function is deprecated and is only kept for backwards compatibility. For new development, use Module:Function/3.