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![]() | ||
graphql/4 | Quasi-quotation syntax for embedding GraphQL in Prolog text. | ![]() |
graphql_auth_token_hook/2 | Multifile, dynamic hook. | ![]() |
graphql_document_to_codes/3 | Serialize Document, a Prolog term representing a GraphQL document as obtained from graphql_read_document/3 or the graphql/4 quasi-quotation, and unify Codes with the resulting list of character codes. | ![]() |
graphql_document_to_string/3 | Serialize the GraphQL document Document and unify String with the resulting string. | ![]() |
graphql_execute_document/4 | Send GraphQL document Document to be executed by the GraphQL endpoint at URI. | ![]() |
graphql_read_document/3 | True when Document is a term representing the abstract syntax tree obtained from parsing Source as a GraphQL executable document. | ![]() |
html_decl.pl -- HTML emitter analysis and IDE support![]() | ||
html_head.pl -- Automatic inclusion of CSS and scripts links![]() | ||
html_quasiquotations.pl![]() | ||
html/4 | The predicate html/4 implements HTML quasi quotations. | ![]() |
html_write.pl -- Write HTML text![]() | ||
htmx.pl -- Support htmx.org![]() | ||
htmx_oob/4 | Emit an htmx out-of-band element. | ![]() |
reply_htmx/1 | Reply a plain HTML element as opposed to a complete HTML page as created using reply_html_page/2,3. | ![]() |
reply_htmx/2 | Reply a plain HTML element as opposed to a complete HTML page as created using reply_html_page/2,3. | ![]() |
http_authenticate.pl -- Authenticate HTTP connections using 401 headers![]() | ||
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_cookie.pl -- HTTP client cookie handling![]() | ||
update_cookies/3 | Update the client cookie database. | ![]() |
write_cookies/3 | Emit a cookie header for the current request. | ![]() |
cookie_remove_all_clients/0 | Simply logout all clients. | ![]() |
cookie_remove_client/1 | Fake user quitting a browser. | ![]() |
http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing![]() | ||
http_digest.pl -- HTTP Digest authentication![]() | ||
authenticate/3 | Plugin for library(http_dispatch) to perform basic HTTP authentication. | ![]() |
authenticate_client/2 | This hooks is called by http_open/3 with the following Action value:. | ![]() |
http_digest_challenge/4 | Generate the content for a 401 WWW-Authenticate: Digest header field. | ![]() |
http_digest_password_hash/4 | Compute the password hash for the HTTP password file. | ![]() |
http_digest_response/5 | Formulate a reply to a digest authentication request. | ![]() |
http_parse_digest_challenge/2 | Parse the value of an HTTP WWW-Authenticate header into a list of Name(Value) terms. | ![]() |
http_dirindex.pl![]() | ||
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_dyn_workers.pl![]() | ||
schedule_workers/1 | Called if there is no immediately free worker to handle the incoming request. | ![]() |
http_error.pl![]() | ||
http_exception.pl -- Map Prolog exceptions to HTTP errors![]() | ||
http_files.pl![]() | ||
http_reply_from_files/3 | HTTP handler that serves files from the directory Dir. | ![]() |
http_header.pl![]() | ||
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 | Convert between a SWI-Prolog time stamp and a string 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![]() | ||
http_host.pl -- Obtain public server location![]() | ||
http_json.pl -- HTTP JSON Plugin module![]() | ||
http_load.pl -- Load Prolog code from a web server![]() | ||
prolog_load_file/2 | Hook into load_files/2 that loads http:// and https:// resources directly from the web. | ![]() |
http_log.pl![]() | ||
http_log/2 | Write message from Format and Args to log-stream. | ![]() |
http_log_close/1 | If there is a currently open HTTP logfile, close it after adding a term server(Reason, Time) . | ![]() |
http_log_stream/1 | True when Stream is a stream to the opened HTTP log file. | ![]() |
http_logrotate/1 | Rotate the available log files. | ![]() |
http_schedule_logrotate/2 | Schedule log rotation based on maintenance broadcasts. | ![]() |
nolog/1 | Multifile predicate that can be defined to hide request parameters from the request logfile. | ![]() |
nolog_post_content_type/1 | Multifile hook called with the Content-type header. | ![]() |
password_field/1 | Multifile predicate that can be defined to hide passwords from the logfile. | ![]() |
post_data_encoded/2 | Encode the POST body for inclusion into the HTTP log file. | ![]() |
http_multipart_plugin.pl![]() | ||
http_convert_data/4 | Convert multipart/form-data messages for http_read_data/3. | ![]() |
http_open.pl -- HTTP client library![]() | ||
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![]() | ||
try_proxy/4 | Connection is via an HTTP proxy for socket: Use HTTP CONNECT. | ![]() |
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/1 | Create an HTTP server using http_dispatch/1 for handling requests. | ![]() |
http_server_files.pl![]() | ||
serve_files_in_directory/2 | Serve files from the directory Alias from the path-info from Request. | ![]() |
http_server_health.pl -- HTTP Server health statistics![]() | ||
http_session.pl -- HTTP Session management![]() | ||
http_sgml_plugin.pl -- Parse of HTML and XML documents for the HTTP client libs![]() | ||
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 -- 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![]() | ||
current_hub/2 | True when there exists a hub Hub with Name. | ![]() |
hub_add/3 | Add a WebSocket to the hub. | ![]() |
hub_broadcast/2 | Send Message to all websockets associated with Hub for which call(Condition, Id) succeeds. | ![]() |
hub_broadcast/3 | Send Message to all websockets associated with Hub for which call(Condition, Id) succeeds. | ![]() |
hub_create/3 | Create a new hub. | ![]() |
hub_member/2 | True when Id is a member of the hub HubName. | ![]() |
hub_send/2 | Send message to the indicated ClientId. | ![]() |
js_grammar.pl![]() | ||
js_token/3 | Matches and classifies the next JavaScript token. | ![]() |
js_write.pl -- Utilities for including JavaScript![]() | ||
json.pl![]() | ||
atom_json_dict/3 | Convert between textual representation and a JSON term represented as a dict. | ![]() |
atom_json_term/3 | Convert between textual representation and a JSON term. | ![]() |
is_json_term/1 | True if Term is a json term. | ![]() |
is_json_term/2 | True if Term is a json term. | ![]() |
json_dict_pairs/2 | This hook may be used to order the keys of an object. | ![]() |
json_read/2 | Read next JSON value from Stream into a Prolog term. | ![]() |
json_read/3 | Read next JSON value from Stream into a Prolog term. | ![]() |
json_read_dict/2 | Read a JSON object, returning objects as a dicts. | ![]() |
json_read_dict/3 | Read a JSON object, returning objects as a dicts. | ![]() |
json_write/2 | Write a JSON term to Stream. | ![]() |
json_write/3 | Write a JSON term to Stream. | ![]() |
json_write_dict/2 | Write a JSON term, represented using dicts. | ![]() |
json_write_dict/3 | Write a JSON term, represented using dicts. | ![]() |
json_write_hook/4 | Hook that can be used to emit a JSON representation for Term to Stream. | ![]() |
json_convert.pl -- Convert between JSON terms and Prolog application terms![]() | ||
current_json_object/3 | Multifile predicate computed from the json_object/1 declarations. | ![]() |
json_object/1 | Declare a JSON object. | ![]() |
json_to_prolog/2 | Translate a JSON term into an application term. | ![]() |
prolog_bool_to_json/2 | JSON is the JSON boolean for Prolog. | ![]() |
prolog_to_json/2 | Translate a Prolog application Term into a JSON object term. | ![]() |
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![]() | ||
term/4 | Render a Prolog term as a structured HTML tree. | ![]() |
thread_httpd.pl -- Threaded HTTP server![]() | ||
websocket.pl -- WebSocket support![]() | ||
yadis.pl![]() | ||
ssl_verify/5 | Accept all certificates. | ![]() |
xrds_dom/2 | True when XRDS_DOM is a parsed XML document for the given resource. | ![]() |
xrds_location/2 | Discover the location of the XRDS document from the given Id. | ![]() |