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 -- Automatic inclusion of CSS and scripts links![]() | ||
html_quasiquotations.pl![]() | ||
| html/4 | The predicate html/4 implements 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![]() | ||
| post_data_hook/3 | Hook to extend the datatypes supported by the post(Data) option of http_open/3. | ![]() |
| http_convert_data/4 | Multi-file hook to convert a HTTP payload according to the Content-Type header. | ![]() |
| http_delete/3 | Execute a DELETE method on the server. | ![]() |
| http_disconnect/1 | Close down some connections. | ![]() |
| http_get/3 | Get data from a URL server and convert it to a suitable Prolog representation based on the Content-Type header and plugins. | ![]() |
| http_patch/4 | Issue an HTTP PATCH request. | ![]() |
| http_post/4 | Issue an HTTP POST request. | ![]() |
| http_put/4 | Issue an HTTP PUT request. | ![]() |
| http_read_data/3 | Read data from an HTTP connection and convert it according to the supplied to(Format) option or based on the Content-type in the Request. | ![]() |
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![]() | ||
| http_convert_data/4 | Convert multipart/form-data messages for http_read_data/3. | ![]() |
http_open.pl![]() | ||
| disable_encoding_filter/1 | Do not use the Content-encoding as Transfer-encoding encoding for specific values of ContentType. | ![]() |
| http_close_keep_alive/1 | Close all keep-alive connections matching Address. | ![]() |
| http_open/3 | Open the data at the HTTP server as a Prolog stream. | ![]() |
| http_set_authorization/2 | Set user/password to supply with URLs that have URL as prefix. | ![]() |
| keep_alive/4 | Callback when closing the range stream used to process the content of the reply. | ![]() |
| map_method/2 | Support additional METHOD keywords. | ![]() |
| open_hook/6 | Hook implementation that makes open_any/5 support http and https URLs for Mode == read. | ![]() |
http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests![]() | ||
http_path.pl![]() | ||
| location/3 | Multifile hook used to specify new HTTP locations. | ![]() |
| http_absolute_location/3 | Path is the HTTP location for the abstract specification Spec. | ![]() |
| http_absolute_uri/2 | URI is the absolute (i.e., starting with http://) URI for the abstract specification Spec. | ![]() |
| http_clean_location_cache/0 | HTTP locations resolved through http_absolute_location/3 are cached. | ![]() |
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 -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
http_wrapper.pl -- Server processing of an HTTP request![]() | ||
hub.pl![]() | ||
| current_hub/2 | True when there exists a hub Hub with Name. | ![]() |
| hub_add/3 | Add a WebSocket to the hub. | ![]() |
| hub_broadcast/2 | Send Message to all websockets associated with Hub for which call(Condition, Id) succeeds. | ![]() |
| hub_broadcast/3 | Send Message to all websockets associated with Hub for which call(Condition, Id) succeeds. | ![]() |
| hub_create/3 | Create a new hub. | ![]() |
| hub_member/2 | True when Id is a member of the hub HubName. | ![]() |
| hub_send/2 | Send message to the indicated ClientId. | ![]() |
js_write.pl -- Utilities for including JavaScript![]() | ||
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![]() | ||