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_meta/1 | This directive can be used to declare that an HTML rendering rule takes HTML content as argument. | ![]() |
| html_no_content/1 | True when Element has no content. | ![]() |
html_head.pl![]() | ||
| html_current_resource/1 | True when About is a currently known resource. | ![]() |
| html_insert_resource/3 | Actually include HTML head resources. | ![]() |
| html_requires/3 | Include ResourceOrList and all dependencies derived from it and add them to the HTML head using html_post/2. | ![]() |
| html_resource/2 | Register an HTML head resource. | ![]() |
| mime_include/4 | Hook called to include a link to an HTML resource of type Mime into the HTML head. | ![]() |
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![]() | ||
| cors_enable/0 | Emit the HTTP header Access-Control-Allow-Origin using domains from the setting http:cors. | ![]() |
| cors_enable/2 | CORS reply to a Preflight OPTIONS request. | ![]() |
http_dispatch.pl![]() | ||
| http_404/2 | Reply using an "HTTP 404 not found" page. | ![]() |
| http_current_handler/2 | True if Location is handled by Closure. | ![]() |
| http_current_handler/3 | Resolve the current handler and options to execute it. | ![]() |
| http_delete_handler/1 | Delete handler for Spec. | ![]() |
| http_dispatch/1 | Dispatch a Request using http_handler/3 registrations. | ![]() |
| http_handler/3 | Register Closure as a handler for HTTP requests. | ![]() |
| http_link_to_id/3 | HREF is a link on the local server to a handler with given ID, passing the given Parameters. | ![]() |
| http_location_by_id/2 | True when Location represents the HTTP path to which the handler with identifier ID is bound. | ![]() |
| http_redirect/3 | Redirect to a new location. | ![]() |
| http_reload_with_parameters/3 | Create a request on the current handler with replaced search parameters. | ![]() |
| http_reply_file/3 | Options is a list of. | ![]() |
| http_request_expansion/2 | Register Goal for expanding the HTTP request handler. | ![]() |
| http_safe_file/2 | True if FileSpec is considered safe. | ![]() |
| http_switch_protocol/2 | Send an "HTTP 101 Switching Protocols" reply. | ![]() |
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 -- HTTP library hooks![]() | ||
http_host.pl -- Obtain public server location![]() | ||
http_log.pl -- HTTP Logging module![]() | ||
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![]() | ||
| charset/3 | Hook that determines the Charset for File that has media type MediaType. | |
| mime_extension/2 | Hook that is called by file_mime_type/2 before the default table is examined. | |
| file_content_type/2 | True if File should be served using ContentType: ContentType. | ![]() |
| file_content_type/3 | True if File should be served using ContentType: ContentType. | ![]() |
| file_mime_type/2 | True when MimeType is the mime-type to be used for sending FileName. | ![]() |
term_html.pl -- Represent Prolog terms as HTML![]() | ||
thread_httpd.pl![]() | ||
websocket.pl -- WebSocket support![]() | ||