SWI-Prolog HTTP support library

This directory provides the SWI-Prolog libraries for accessing and providing HTTP services.

Client library

The main client library is library(http/http_open), which can open both HTTP and HTTPS connections and handle all request methods.

Server library

The main server libraris are

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.

Requirements

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.

Prolog files

html_head.pl  -- Automatic inclusion of CSS and scripts linksShow source
html_quasiquotations.pl  -- HTML quasi quotationsShow source
html_write.pl  -- Write HTML textShow source
http_client.pl  -- HTTP client libraryShow source
http_cors.pl  -- Enable CORS: Cross-Origin Resource SharingShow source
http_dispatch.pl  -- Dispatch requests in the HTTP serverShow source
http_dyn_workers.pl  -- Dynamically schedule HTTP workers.Show source
http_exception.pl  -- Map Prolog exceptions to HTTP errorsShow source
http_header.pl  -- Handling HTTP headersShow source
http_hook.pl  -- HTTP library hooksShow source
http_host.pl  -- Obtain public server locationShow source
http_current_host/4Source
http_public_host/4Current global host and port of the HTTP server.Source
http_public_host_url/2True when URL is the public URL at which this server can be contacted.Source
http_public_url/2True when URL is an absolute URL for the current request.Source
http_json.pl  -- HTTP JSON Plugin moduleShow source
http_log.pl  -- HTTP Logging moduleShow source
http_multipart_plugin.pl  -- Multipart form-data pluginShow source
http_open.pl  -- HTTP client libraryShow source
http_parameters.pl  -- Extract parameters (GET and POST) from HTTP requestsShow source
http_path.pl  -- Abstract specification of HTTP server locationsShow source
http_redis_plugin.pl  -- Hook session management to use RedisShow source
http_server.pl  -- HTTP server libraryShow source
http_server_files.pl  -- Serve files needed by modules from the serverShow source
http_server_health.pl  -- HTTP Server health statisticsShow source
http_session.pl  -- HTTP Session managementShow source
http_stream.pl  -- HTTP StreamsShow source
http_unix_daemon.pl  -- Run SWI-Prolog HTTP server as a Unix system daemonShow source
http_wrapper.pl  -- Server processing of an HTTP requestShow source
hub.pl  -- Manage a hub for websocketsShow source
js_grammar.pl  -- JavaScript grammarShow source
js_write.pl  -- Utilities for including JavaScriptShow source
json.pl  -- Reading and writing JSON serializationShow source
mimetype.pl  -- Determine mime-type for a fileShow source
term_html.pl  -- Represent Prolog terms as HTMLShow source
thread_httpd.plShow source
websocket.pl  -- WebSocket supportShow source