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 -- Write HTML text![]() | ||
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 -- Dynamically schedule HTTP workers.![]() | ||
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 Session management![]() | ||
http_stream.pl -- HTTP Streams![]() | ||
http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
http_wrapper.pl![]() | ||
| cgi_hook/2 | Hook called from the CGI processing stream. | ![]() |
| http_current_request/1 | Returns the HTTP request currently being processed. | ![]() |
| http_peer/2 | True when PeerIP is the IP address of the connection peer. | ![]() |
| http_relative_path/2 | Convert an absolute path (without host, fragment or search) into a path relative to the current page. | ![]() |
| http_send_header/1 | This API provides an alternative for writing the header field as a CGI header. | ![]() |
| http_spawned/1 | Internal use only. | ![]() |
| http_wrap_spawned/3 | Internal use only. | ![]() |
| http_wrapper/5 | Simple wrapper to read and decode an HTTP header from `In', call :Goal while watching for exceptions and send the result to the stream `Out'. | ![]() |
hub.pl -- Manage a hub for websockets![]() | ||
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![]() | ||
| schedule_workers/1 | Hook called if a new connection or a keep-alive connection cannot be scheduled immediately to a worker. | ![]() |
| http_add_worker/2 | Add a new worker to the HTTP server for port Port. | ![]() |
| http_close_connection/1 | Close connection associated to Request. | ![]() |
| http_current_server/2 | True if Goal is the goal of a server at Port. | ![]() |
| http_current_worker/2 | True if ThreadID is the identifier of a Prolog thread serving Port. | ![]() |
| http_enough_workers/3 | Check that we have enough workers in our queue. | ![]() |
| http_requeue/1 | Re-queue a connection to the worker pool. | ![]() |
| http_server/2 | Create a server at Port that calls Goal for each parsed request. | ![]() |
| http_server_property/2 | True if Property is a property of the HTTP server running at Port. | ![]() |
| http_spawn/2 | Continue this connection on a new thread. | ![]() |
| http_stop_server/2 | Stop the indicated HTTP server gracefully. | ![]() |
| http_workers/2 | Query or set the number of workers for the server at this port. | ![]() |
| message_level/2 | Determine the message stream used for exceptions that may occur during server_loop/5. | ![]() |
websocket.pl -- WebSocket support![]() | ||