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![]() | ||
| html_current_resource/1 | True when About is a currently known resource. | ![]() |
| html_insert_resource/3 | Actually include HTML head resources. | ![]() |
| 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/4 | The predicate html/4 implements 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![]() | ||
| 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_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_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. | ![]() |
| session_setting/2 | Find setting for SessionID. | ![]() |
http_stream.pl![]() | ||
| current_transfer_encoding/1 | True if Encoding is supported. | ![]() |
| encoding_filter/3 | Install a filter to deal with chunked encoded messages. | ![]() |
| cgi_discard/1 | Discard content produced so far. | ![]() |
| cgi_open/4 | Process CGI output. | ![]() |
| cgi_property/2 | Inquire the status of the CGI stream. | ![]() |
| cgi_set/2 | Change one of the properties. | ![]() |
| cgi_statistics/1 | Return statistics on the CGI stream subsystem. | ![]() |
| http_chunked_add_trailer/3 | Add a trailer key/value to DataStream. | ![]() |
| http_chunked_flush/2 | Emits the next chunk flush_output/1 on DataStream, but in addition adds extension parameters to the chunk. | ![]() |
| http_chunked_open/3 | Create a stream to realise HTTP chunked encoding or decoding. | ![]() |
| http_is_chunked/1 | True if DataStream is created using http_chunked_open/3. | ![]() |
| is_cgi_stream/1 | True if Stream is a CGI stream created using cgi_open/4. | ![]() |
| multipart_open/3 | DataStream is a stream that signals end_of_file if the multipart boundary is encountered. | ![]() |
| multipart_open_next/1 | Prepare DataStream to read the next part from the multipart input data. | ![]() |
| stream_range_open/3 | DataStream is a stream whose size is defined by the option size(ContentLength). | ![]() |
http_unix_daemon.pl![]() | ||
| 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_opt_help/2 | Allow reusing http option processing. | ![]() |
| http_opt_meta/2 | Allow reusing http option processing. | ![]() |
| http_opt_type/3 | Allow reusing http option processing. | ![]() |
| http_server_hook/1 | Hook that is called to start the HTTP server. | ![]() |
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. | ![]() |
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![]() | ||