Availability:
:- use_module(library(http/http_pwp)).
Options supported are:
- mime_type(+Type)
- Serve the file using the given mime-type. Default is text/html.
- unsafe(+Boolean)
- Passed to http_safe_file/2 to check for unsafe paths.
- pwp_module(+Boolean)
- If
true
, (defaultfalse
), process the PWP file in a module constructed from its canonical absolute path. Otherwise, the PWP file is processed in the calling module.
Initial context:
- SCRIPT_NAME
- Virtual path of the script.
- SCRIPT_DIRECTORY
- Physical directory where the script lives
- QUERY
- Var=Value list representing the query-parameters
- REMOTE_USER
- If access has been authenticated, this is the authenticated user.
- REQUEST_METHOD
- One of
get
,post
,put
orhead
- CONTENT_TYPE
- Content-type provided with HTTP POST and PUT requests
- CONTENT_LENGTH
- Content-length provided with HTTP POST and PUT requests
While processing the script, the file-search-path pwp includes the current location of the script. I.e., the following will find myprolog in the same directory as where the PWP file resides.
pwp:ask="ensure_loaded(pwp(myprolog))"
- See also
- pwp_handler/2.
- To be done
- complete the initial context, as far as possible from CGI variables. See http://hoohoo.ncsa.illinois.edu/docs/cgi/env.html