| Did you know ... | Search Documentation: |
| Title for pldoc(dir_index) |
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.
ax.pl -- Attribute Exchange library![]() | ||
|---|---|---|
graphql.pl -- GraphQL interface![]() | ||
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![]() | ||
htmx.pl -- Support htmx.org![]() | ||
http_authenticate.pl -- Authenticate HTTP connections using 401 headers![]() | ||
http_client.pl -- HTTP client library![]() | ||
| 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_cookie.pl -- HTTP client cookie handling![]() | ||
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_dirindex.pl -- HTTP directory listings![]() | ||
| mime_type_icon/2 | Multi-file hook predicate that can be used to associate icons to files listed by http_reply_dirindex/3. | ![]() |
| directory_index/4 | Show index for a directory. | ![]() |
| http_reply_dirindex/3 | Provide a directory listing for Request, assuming it is an index for the physical directrory Dir. | ![]() |
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.![]() | ||
| schedule_workers/1 | Called if there is no immediately free worker to handle the incoming request. | ![]() |
http_error.pl -- Decorate uncaught HTTP exceptions with stack-trace![]() | ||
http_exception.pl -- Map Prolog exceptions to HTTP errors![]() | ||
| bad_request_error/2 | If an exception of the term error(Formal, context(Stack, Context)) is caught and subsumes_term(ContextTemplate, Context) is true, translate the exception into an HTTP 400 exception. | |
| in_or_exclude_backtrace/2 | Remove the stacktrace from the exception, unless setting http:client_backtrace is true. | ![]() |
| map_exception_to_http_status/4 | Map certain exceptions to HTTP status codes. | ![]() |
http_files.pl -- Serve plain files from a hierarchy![]() | ||
http_header.pl -- Handling HTTP headers![]() | ||
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_load.pl -- Load Prolog code from a web server![]() | ||
http_log.pl -- HTTP Logging 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. | ![]() |
| keep_alive/4 | Callback when closing the range stream used to process the content of the reply. | ![]() |
| map_method/2 | Support additional METHOD keywords. | ![]() |
| open_hook/6 | Hook implementation that makes open_any/5 support http and https URLs for Mode == read. | ![]() |
http_openid.pl -- OpenID consumer and server library![]() | ||
http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests![]() | ||
http_path.pl -- Abstract specification of HTTP server locations![]() | ||
http_proxy.pl -- Use HTTP network proxies![]() | ||
http_pwp.pl -- Serve PWP pages through the HTTP server![]() | ||
| pwp_handler/2 | Handle PWP files. | ![]() |
| reply_pwp_page/3 | Reply a PWP file. | ![]() |
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![]() | ||
| health/2 | Multifile extensible. | ![]() |
| hide/1 | Multifile hook. | ![]() |
| server_health/1 | HTTP handler that replies with the overall health of the server. | ![]() |
http_session.pl -- HTTP Session management![]() | ||
http_sgml_plugin.pl -- Parse of HTML and XML documents for the HTTP client libs![]() | ||
http_stream.pl -- HTTP Streams![]() | ||
| 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 -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
http_wrapper.pl -- Server processing of an HTTP request![]() | ||
| 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![]() | ||
| charset/3 | Hook that determines the Charset for File that has media type MediaType. | |
| mime_extension/2 | Hook that is called by file_mime_type/2 before the default table is examined. | |
| file_content_type/2 | True if File should be served using ContentType: ContentType. | ![]() |
| file_content_type/3 | True if File should be served using ContentType: ContentType. | ![]() |
| file_mime_type/2 | True when MimeType is the mime-type to be used for sending FileName. | ![]() |
term_html.pl -- Represent Prolog terms as HTML![]() | ||
| term/4 | Render a Prolog term as a structured HTML tree. | ![]() |
thread_httpd.pl -- Threaded HTTP server![]() | ||
websocket.pl -- WebSocket support![]() | ||
yadis.pl -- Yadis discovery![]() | ||