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 libarys 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.
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_head.pl -- Automatic inclusion of CSS and scripts links![]() | ||
---|---|---|
html_current_resource/1 | True when About is a currently known resource. | ![]() |
html_requires/3 | Include ResourceOrList and all dependencies derived from it and add them to the HTML head using html_post/2. | ![]() |
html_resource/2 | Register an HTML head resource. | ![]() |
mime_include/4 | Hook called to include a link to an HTML resource of type Mime into the HTML head. | ![]() |
html_quasiquotations.pl -- HTML quasi quotations![]() | ||
html_write.pl -- Write HTML text![]() | ||
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_meta/1 | This directive can be used to declare that an HTML rendering rule takes HTML content as argument. | ![]() |
html_post/4 | Reposition HTML to the receiving Id. | ![]() |
html_print_length/2 | Determine the content length of a token list produced using html//1. | ![]() |
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 channal 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. | ![]() |
xhtml_ns/4 | Demand an xmlns:id=Value in the outer html tag. | ![]() |
http_authenticate.pl -- Authenticate HTTP connections using 401 headers![]() | ||
http_authenticate/3 | True if Request contains the information to continue according to Type. | ![]() |
http_authorization_data/2 | Decode the HTTP Authorization header. | ![]() |
http_current_user/3 | True when User is present in the htpasswd file File and Fields provides the additional fields. | ![]() |
http_read_passwd_file/2 | Read a password file. | ![]() |
http_write_passwd_file/2 | Write password data Data to File. | ![]() |
authenticate/3 | Plugin for library(http_dispatch) to perform basic HTTP authentication. | ![]() |
http_client.pl -- HTTP client library![]() | ||
http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing![]() | ||
cors_enable/0 | Emit the HTTP header Access-Control-Allow-Origin using domains from the setting http:cors. | ![]() |
cors_enable/2 | CORS reply to a Preflight OPTIONS request. | ![]() |
http_digest.pl -- HTTP Digest authentication![]() | ||
http_dispatch.pl -- Dispatch requests in the HTTP server![]() | ||
http_404/2 | Reply using an "HTTP 404 not found" page. | ![]() |
http_current_handler/2 | True if Location is handled by Closure. | ![]() |
http_current_handler/3 | Resolve the current handler and options to execute it. | ![]() |
http_delete_handler/1 | Delete handler for Spec. | ![]() |
http_dispatch/1 | Dispatch a Request using http_handler/3 registrations. | ![]() |
http_handler/3 | Register Closure as a handler for HTTP requests. | ![]() |
http_link_to_id/3 | HREF is a link on the local server to a handler with given ID, passing the given Parameters. | ![]() |
http_location_by_id/2 | True when Location represents the HTTP path to which the handler with identifier ID is bound. | ![]() |
http_redirect/3 | Redirect to a new location. | ![]() |
http_reload_with_parameters/3 | Create a request on the current handler with replaced search parameters. | ![]() |
http_reply_file/3 | Options is a list of. | ![]() |
http_request_expansion/2 | Register Goal for expanding the HTTP request handler. | ![]() |
http_safe_file/2 | True if FileSpec is considered safe. | ![]() |
http_switch_protocol/2 | Send an "HTTP 101 Switching Protocols" reply. | ![]() |
http_dyn_workers.pl -- Dynamically schedule HTTP workers.![]() | ||
http_exception.pl -- Map Prolog exceptions to HTTP errors![]() | ||
http_header.pl -- Handling HTTP headers![]() | ||
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 | Generate a description of a Time 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![]() | ||
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_current_host/4 | ![]() | |
http_public_host/4 | Current global host and port of the HTTP server. | ![]() |
http_public_host_url/2 | True when URL is the public URL at which this server can be contacted. | ![]() |
http_public_url/2 | True when URL is an absolute URL for the current request. | ![]() |
http_json.pl -- HTTP JSON Plugin module![]() | ||
http_multipart_plugin.pl -- Multipart form-data plugin![]() | ||
http_open.pl -- HTTP client library![]() | ||
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. | ![]() |
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 -- Abstract specification of HTTP server locations![]() | ||
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_server_files.pl -- Serve files needed by modules from the server![]() | ||
serve_files_in_directory/2 | Serve files from the directory Alias from the path-info from Request. | ![]() |
http_session.pl -- HTTP Session management![]() | ||
http_close_session/1 | Closes an HTTP session. | ![]() |
http_current_session/2 | Enumerate the current sessions and associated data. | ![]() |
http_in_session/1 | True if SessionId is an identifier for the current session. | ![]() |
http_open_session/2 | Establish a new session. | ![]() |
http_session_assert/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
http_session_assert/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
http_session_asserta/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
http_session_asserta/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
http_session_cookie/1 | Generate a random cookie that can be used by a browser to identify the current session. | ![]() |
http_session_data/1 | True if Data is associated using http_session_assert/1 to the current HTTP session. | ![]() |
http_session_data/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
http_session_id/1 | True if SessionId is an identifier for the current session. | ![]() |
http_session_option/1 | True if Option is a current option of the session system. | ![]() |
http_session_retract/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
http_session_retract/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
http_session_retractall/1 | Versions of assert/1, retract/1 and retractall/1 that associate data with the current HTTP session. | ![]() |
http_session_retractall/2 | Versions of assert/1, retract/1 and retractall/1 that associate data with an explicit HTTP session. | ![]() |
http_set_session/1 | Overrule a setting for the current or specified session. | ![]() |
http_set_session/2 | Overrule a setting for the current or specified session. | ![]() |
http_set_session_options/1 | Set options for the session library. | ![]() |
http_ssl_plugin.pl -- SSL plugin for HTTP libraries![]() | ||
http_connection_over_proxy/6 | Facilitate an HTTPS connection via a proxy using HTTP CONNECT. | ![]() |
http_protocol_hook/5 | Hook for http_open/3 to connect to an HTTPS (SSL-based HTTP) server. | ![]() |
open_options/2 | Implementation of the multifile hook http:open_options/2 used by library(http/http_open). | ![]() |
ssl_server_create_hook/3 | Extensible predicate that is called once after creating an HTTPS server. | |
ssl_server_open_client_hook/3 | Extensible predicate that is called before each connection that the server negotiates with a client. | |
accept_hook/2 | Implement the accept for HTTPS connections. | ![]() |
make_socket_hook/3 | Hook into http_server/2 to create an SSL server if the option ssl(SSLOptions) is provided. | ![]() |
http_stream.pl -- HTTP Streams![]() | ||
http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
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_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![]() | ||
jquery.pl -- Provide JQuery![]() | ||
js_grammar.pl -- JavaScript grammar![]() | ||
js_write.pl -- Utilities for including JavaScript![]() | ||
json.pl -- Reading and writing JSON serialization![]() | ||
mimepack.pl -- Create a MIME message![]() | ||
mimetype.pl -- Determine mime-type for a file![]() | ||
term_html.pl -- Represent Prolog terms as HTML![]() | ||
blob_rendering/5 | Hook to render blob atoms as HTML. | ![]() |
term/4 | Render a Prolog term as a structured HTML tree. | ![]() |
thread_httpd.pl -- Threaded HTTP server![]() | ||
websocket.pl -- WebSocket support![]() | ||
http_open_websocket/3 | Establish a client websocket connection. | ![]() |
http_upgrade_to_websocket/3 | Create a websocket connection running call(Goal, WebSocket) , where WebSocket is a socket-pair. | ![]() |
ws_close/3 | Close a WebSocket connection by sending a close message if this was not already sent and wait for the close reply. | ![]() |
ws_open/3 | Turn a raw TCP/IP (or any other binary stream) into a websocket stream. | ![]() |
ws_property/2 | True if Property is a property WebSocket. | ![]() |
ws_receive/2 | Receive the next message from WebSocket. | ![]() |
ws_receive/3 | Receive the next message from WebSocket. | ![]() |
ws_send/2 | Send a message over a websocket. | ![]() |