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 -- Dynamically schedule HTTP workers.![]() | ||
http_exception.pl -- Map Prolog exceptions to HTTP errors![]() | ||
http_header.pl![]() | ||
| http_address/2 | HTML-rule that emits the location of the HTTP server. | |
| mime_type_encoding/2 | Encoding is the (default) character encoding for MimeType. | |
| serialize_reply/2 | Multifile hook to serialize the result of status_reply/3 into a term. | ![]() |
| status_page/3 | Hook called by http_status_reply/4 and http_status_reply/5 that allows for emitting custom error pages for the following HTTP page types:. | |
| http_join_headers/3 | Append headers from Default to Header if they are not already part of it. | ![]() |
| http_parse_header/2 | Header is a list of Name(Value)-terms representing the structure of the HTTP header in Text. | ![]() |
| http_parse_header_value/3 | Translate Value in a meaningful Prolog term. | ![]() |
| http_post_data/3 | Send data on behalf on an HTTP POST request. | ![]() |
| http_read_header/2 | Read Name: Value lines from FD until an empty line is encountered. | ![]() |
| http_read_reply_header/2 | Read the HTTP reply header. | ![]() |
| http_read_request/2 | Read an HTTP request-header from FdIn and return the broken-down request fields as +Name(+Value) pairs in a list. | ![]() |
| http_reply/2 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/3 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/4 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/5 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/6 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply_header/3 | Create a reply header using reply_header//3 and send it to Stream. | ![]() |
| http_status_reply/4 | Emit HTML non-200 status reports. | ![]() |
| http_status_reply/5 | Emit HTML non-200 status reports. | ![]() |
| http_timestamp/2 | Convert between a SWI-Prolog time stamp and a string in HTTP format (RFC1123). | ![]() |
| http_update_connection/4 | Merge keep-alive information from Request and CGIHeader into Header. | ![]() |
| http_update_encoding/3 | Allow for rewrite of the header, adjusting the encoding. | ![]() |
| http_update_transfer/4 | Decide on the transfer encoding from the Request and the CGI header. | ![]() |
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 -- 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 -- 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![]() | ||