This directory provides the SWI-Prolog libraries for accessing and providing HTTP services.
The main client library is library(http/http_open), which can open
both HTTP and HTTPS connections and handle all request methods.
The main server libraries are
library(http/thread_httpd) implements the serverlibrary(http/http_dispatch) implements binding locations
predicateslibrary(http/http_unix_daemon) implements integration in various
Unix server managers and in general provides a suitable entry point
for HTTP servers on Unix.library(http/html_write) implements generating HTMLlibrary(http/http_json) implements reading and writing JSON documents.
For simplicity, you can use library(http/http_server), which
combines the typical HTTP libraries that most servers need. The
idea of a common request handling system and three controlling
libraries is outdated; the threaded server now being the only sensible
controlling library.
This library uses functionality from the ssl package to support HTTPS,
the sgml package to read XML/HTML and the clib package for various
extensions.
html_decl.pl -- HTML emitter analysis and IDE support![]() | ||
|---|---|---|
html_head.pl -- Automatic inclusion of CSS and scripts links![]() | ||
html_quasiquotations.pl![]() | ||
| html/4 | The predicate html/4 implements HTML quasi quotations. | ![]() |
html_write.pl -- Write HTML text![]() | ||
http_client.pl -- HTTP client library![]() | ||
http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing![]() | ||
http_dispatch.pl -- Dispatch requests in the HTTP server![]() | ||
http_dyn_workers.pl![]() | ||
| schedule_workers/1 | Called if there is no immediately free worker to handle the incoming request. | ![]() |
http_exception.pl -- Map Prolog exceptions to HTTP errors![]() | ||
http_header.pl -- Handling HTTP headers![]() | ||
http_hook.pl![]() | ||
| convert_parameter/3 | Hook to execute a step in the HTTP parameter conversion process. | |
| http_connection_over_proxy/6 | Try to connect to the host Endpoint via Proxy for the purposes of retrieving the resource identified by URLParts. | ![]() |
http_host.pl -- Obtain public server location![]() | ||
http_log.pl![]() | ||
| http_log/2 | Write message from Format and Args to log-stream. | ![]() |
| http_log_close/1 | If there is a currently open HTTP logfile, close it after adding a term server(Reason, Time). | ![]() |
| http_log_stream/1 | True when Stream is a stream to the opened HTTP log file. | ![]() |
| http_logrotate/1 | Rotate the available log files. | ![]() |
| http_schedule_logrotate/2 | Schedule log rotation based on maintenance broadcasts. | ![]() |
| nolog/1 | Multifile predicate that can be defined to hide request parameters from the request logfile. | ![]() |
| password_field/1 | Multifile predicate that can be defined to hide passwords from the logfile. | ![]() |
| post_data_encoded/2 | Encode the POST body for inclusion into the HTTP log file. | ![]() |
http_multipart_plugin.pl -- Multipart form-data plugin![]() | ||
http_open.pl -- HTTP client library![]() | ||
http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests![]() | ||
http_path.pl -- Abstract specification of HTTP server locations![]() | ||
http_redis_plugin.pl -- Hook session management to use Redis![]() | ||
http_server.pl -- HTTP server library![]() | ||
http_server_files.pl -- Serve files needed by modules from the server![]() | ||
http_server_health.pl -- HTTP Server health statistics![]() | ||
http_session.pl![]() | ||
| http_close_session/1 | Closes an HTTP session. | ![]() |
| http_current_session/2 | Enumerate the current sessions and associated data. | ![]() |
| http_in_session/1 | True if SessionId is an identifier for the current session. | ![]() |
| http_open_session/2 | Establish a new session. | ![]() |
| http_session_assert/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
| http_session_assert/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
| http_session_asserta/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
| http_session_asserta/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
| http_session_cookie/1 | Generate a random cookie that can be used by a browser to identify the current session. | ![]() |
| http_session_data/1 | True if Data is associated using http_session_assert/1 to the current HTTP session. | ![]() |
| http_session_data/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
| http_session_id/1 | True if SessionId is an identifier for the current session. | ![]() |
| http_session_option/1 | True if Option is a current option of the session system. | ![]() |
| http_session_retract/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
| http_session_retract/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
| http_session_retractall/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
| http_session_retractall/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
| http_set_session/1 | Overrule a setting for the current or specified session. | ![]() |
| http_set_session/2 | Overrule a setting for the current or specified session. | ![]() |
| http_set_session_options/1 | Set options for the session library. | ![]() |
| session_setting/2 | Find setting for SessionID. | ![]() |
http_stream.pl -- HTTP Streams![]() | ||
http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
http_wrapper.pl -- Server processing of an HTTP request![]() | ||
hub.pl -- Manage a hub for websockets![]() | ||
js_write.pl![]() | ||
| javascript/4 | Quasi quotation parser for JavaScript that allows for embedding Prolog variables to substitude identifiers in the JavaScript snippet. | ![]() |
| js_arg/3 | Same as js_expression//1, but fails if Expression is invalid, where js_expression//1 raises an error. | ![]() |
| js_arg_list/3 | Write javascript (function) arguments. | ![]() |
| js_call/3 | Emit a call to a Javascript function. | ![]() |
| js_expression/3 | Emit a single JSON argument. | ![]() |
| js_new/4 | Emit a call to a Javascript object declaration. | ![]() |
| js_script/3 | Generate a JavaScript script element with the given content. | ![]() |
mimepack.pl -- Create a MIME message![]() | ||
mimetype.pl -- Determine mime-type for a file![]() | ||
term_html.pl -- Represent Prolog terms as HTML![]() | ||
thread_httpd.pl![]() | ||
websocket.pl -- WebSocket support![]() | ||