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 quasi quotations![]() | ||
html_write.pl![]() | ||
| html/3 | Generate HTML from Content. | ![]() |
| html_begin/3 | For html_begin//1, Env is a term Env(Attributes); for html_end//1 it is the plain environment name. | ![]() |
| html_current_option/1 | True if Option is an active option for the HTML generator. | ![]() |
| html_end/3 | For html_begin//1, Env is a term Env(Attributes); for html_end//1 it is the plain environment name. | ![]() |
| html_header_hook/1 | This multifile hook is called just before the Content-type header is emitted. | ![]() |
| html_post/4 | Reposition HTML to the receiving Id. | ![]() |
| html_quoted/3 | Quote the value for normal (CDATA) text. | ![]() |
| html_quoted_attribute/3 | Quote the value according to the rules for tag-attributes included in double-quotes. | ![]() |
| html_receive/3 | Receive posted HTML tokens. | ![]() |
| html_receive/4 | This extended version of html_receive//1 causes Handler to be called to process all messages posted to the channel at the time output is generated. | ![]() |
| html_root_attribute/4 | Add an attribute to the HTML root element of the page. | ![]() |
| html_set_options/1 | Set options for the HTML output. | ![]() |
| layout/3 | Define required newlines before and after tags. | ![]() |
| page/3 | Generate a page including the HTML <!DOCTYPE> header. | ![]() |
| page/4 | Generate a page including the HTML <!DOCTYPE> header. | ![]() |
| print_html/1 | Print list of atoms and layout instructions. | ![]() |
| print_html/2 | Print list of atoms and layout instructions. | ![]() |
| reply_html_page/2 | Provide the complete reply as required by http_wrapper.pl for a page constructed from Head and Body. | ![]() |
| reply_html_page/3 | Provide the complete reply as required by http_wrapper.pl for a page constructed from Head and Body. | ![]() |
| reply_html_partial/1 | Reply with partial HTML document. | ![]() |
| xhtml_ns/4 | Demand an xmlns:id=Value in the outer html tag. | ![]() |
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 -- Dynamically schedule HTTP workers.![]() | ||
http_exception.pl![]() | ||
| bad_request_error/2 | If an exception of the term error(Formal, context(Stack, Context)) is caught and subsumes_term(ContextTemplate, Context) is true, translate the exception into an HTTP 400 exception. | |
| in_or_exclude_backtrace/2 | Remove the stacktrace from the exception, unless setting http:client_backtrace is true. | ![]() |
| map_exception_to_http_status/4 | Map certain exceptions to HTTP status codes. | ![]() |
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 Session management![]() | ||
http_stream.pl -- HTTP Streams![]() | ||
http_unix_daemon.pl![]() | ||
| sni_options/2 | Hook to provide Server Name Indication (SNI) for TLS servers. | |
| http_certificate_hook/3 | Hook called before starting the server if the --https option is used. | ![]() |
| http_daemon/0 | Start the HTTP server as a daemon process. | ![]() |
| http_daemon/1 | Start the HTTP server as a daemon process. | ![]() |
| http_opt_help/2 | Allow reusing http option processing. | ![]() |
| http_opt_meta/2 | Allow reusing http option processing. | ![]() |
| http_opt_type/3 | Allow reusing http option processing. | ![]() |
| http_server_hook/1 | Hook that is called to start the HTTP server. | ![]() |
http_wrapper.pl -- Server processing of an HTTP request![]() | ||
hub.pl -- Manage a hub for websockets![]() | ||
js_write.pl -- Utilities for including JavaScript![]() | ||
mimepack.pl -- Create a MIME message![]() | ||
| mime_pack/3 | Pack a number of inputs into a MIME package using a specified or generated boundary. | ![]() |
mimetype.pl -- Determine mime-type for a file![]() | ||
term_html.pl -- Represent Prolog terms as HTML![]() | ||
thread_httpd.pl -- Threaded HTTP server![]() | ||
websocket.pl -- WebSocket support![]() | ||