SWI-Prolog HTTP support library

This directory provides the SWI-Prolog libraries for accessing and providing HTTP services. The client libraries come in two forms:

The primary server-library is thread_httpd.pl, providing full-blown scalable embedded HTTP server.

Further reading

Prolog files

ax.pl  -- Attribute Exchange libraryShow source
ax_alias/2True when Alias is an alias name for the AX schema URL.Source
ax_form_attributes/2True if Values is a list Alias(Value) for each exchanged attribute.Source
http_ax_attributes/2True when HTTPAttributes is a list of Name=Value pairs that can be used with an HTTP request to query for the attributes Spec.Source
html_head.pl  -- Automatic inclusion of CSS and scripts linksShow source
html_current_resource/1True when About is a currently known resource.Source
html_requires/3Include ResourceOrList and all dependencies derived from it and add them to the HTML head using html_post/2.Source
html_resource/2Register an HTML head resource.Source
mime_include/4Hook called to include a link to an HTML resource of type Mime into the HTML head.Source
html_quasiquotations.pl  -- HTML quasi quotationsShow source
html/4The predicate html/4 implements HTML quasi quotations.Source
html_write.pl  -- Write HTML textShow source
html/3Generate HTML from Content.Source
html_begin/3For html_begin//1, Env is a term Env(Attributes); for html_end//1 it is the plain environment name.Source
html_current_option/1True if Option is an active option for the HTML generator.Source
html_end/3For html_begin//1, Env is a term Env(Attributes); for html_end//1 it is the plain environment name.Source
html_meta/1This directive can be used to declare that an HTML rendering rule takes HTML content as argument.Source
html_post/4Reposition HTML to the receiving Id.Source
html_print_length/2Determine the content length of a token list produced using html//1.Source
html_quoted/3Quote the value for normal (CDATA) text.Source
html_quoted_attribute/3Quote the value according to the rules for tag-attributes included in double-quotes.Source
html_receive/3Receive posted HTML tokens.Source
html_receive/4This 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.Source
html_root_attribute/4Add an attribute to the HTML root element of the page.Source
html_set_options/1Set options for the HTML output.Source
layout/3Define required newlines before and after tags.Source
page/3Generate a page including the HTML <!DOCTYPE> header.Source
page/4Generate a page including the HTML <!DOCTYPE> header.Source
print_html/1Print list of atoms and layout instructions.Source
print_html/2Print list of atoms and layout instructions.Source
reply_html_page/2Provide the complete reply as required by http_wrapper.pl for a page constructed from Head and Body.Source
reply_html_page/3Provide the complete reply as required by http_wrapper.pl for a page constructed from Head and Body.Source
xhtml_ns/4Demand an xmlns:id=Value in the outer html tag.Source
http_authenticate.pl  -- Authenticate HTTP connections using 401 headersShow source
http_client.pl  -- HTTP client libraryShow source
http_cors.pl  -- Enable CORS: Cross-Origin Resource SharingShow source
http_dirindex.pl  -- HTTP directory listingsShow source
http_dispatch.pl  -- Dispatch requests in the HTTP serverShow source
http_error.pl  -- Decorate uncaught HTTP exceptions with stack-traceShow source
http_exception.pl  -- Map Prolog exceptions to HTTP errorsShow source
bad_request_error/2If 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.Source
in_or_exclude_backtrace/2Remove the stacktrace from the exception, unless setting http:client_backtrace is true.Source
map_exception_to_http_status/4Map certain exceptions to HTTP status codes.Source
http_header.pl  -- Handling HTTP headersShow source
http_hook.pl  -- HTTP library hooksShow source
http_host.pl  -- Obtain public server locationShow source
http_json.pl  -- HTTP JSON Plugin moduleShow source
http_log.pl  -- HTTP Logging moduleShow source
http_multipart_plugin.pl  -- Multipart form-data pluginShow source
http_open.pl  -- HTTP client libraryShow source
disable_encoding_filter/1Do not use the Content-encoding as Transfer-encoding encoding for specific values of ContentType.Source
open_options/2This hook is used by the HTTP client library to define default options based on the the broken-down request-URL.Source
update_cookies/3Update the cookie database.Source
write_cookies/3Emit a Cookie: header for the current connection.Source
http_close_keep_alive/1Close all keep-alive connections matching Address.Source
http_open/3Open the data at the HTTP server as a Prolog stream.Source
http_set_authorization/2Set user/password to supply with URLs that have URL as prefix.Source
open_hook/6Hook implementation that makes open_any/5 support http and https URLs for Mode == read.Source
http_openid.pl  -- OpenID consumer and server libraryShow source
http_parameters.pl  -- Extract parameters (GET and POST) from HTTP requestsShow source
http_path.pl  -- Abstract specification of HTTP server locationsShow source
http_server_files.pl  -- Serve files needed by modules from the serverShow source
serve_files_in_directory/2Serve files from the directory Alias from the path-info from Request.Source
http_session.pl  -- HTTP Session managementShow source
http_ssl_plugin.pl  -- SSL plugin for HTTP librariesShow source
http_stream.pl  -- HTTP StreamsShow source
current_transfer_encoding/1True if Encoding is supported.Source
encoding_filter/3Install a filter to deal with chunked encoded messages.Source
cgi_discard/1Discard content produced sofar.Source
cgi_open/4Process CGI output.Source
cgi_property/2Inquire the status of the CGI stream.Source
cgi_set/2Change one of the properies.Source
cgi_statistics/1Return statistics on the CGI stream subsystem.Source
http_chunked_open/3Create a stream to realise HTTP chunked encoding or decoding.Source
is_cgi_stream/1True if Stream is a CGI stream created using cgi_open/4.Source
multipart_open/3DataStream is a stream that signals end_of_file if the multipart boundary is encountered.Source
multipart_open_next/1Prepare DataStream to read the next part from the multipart input data.Source
stream_range_open/3DataStream is a stream whose size is defined by the option size(ContentLength).Source
http_unix_daemon.pl  -- Run SWI-Prolog HTTP server as a Unix system daemonShow source
http_wrapper.pl  -- Server processing of an HTTP requestShow source
hub.pl  -- Manage a hub for websocketsShow source
jquery.pl  -- Provide JQueryShow source
js_grammar.pl  -- JavaScript grammarShow source
js_token/3Matches and classifies the next JavaScript token.Source
js_write.pl  -- Utilities for including JavaScriptShow source
json.pl  -- Reading and writing JSON serializationShow source
json_convert.pl  -- Convert between JSON terms and Prolog application termsShow source
mimepack.pl  -- Create a MIME messageShow source
mimetype.pl  -- Determine mime-type for a fileShow source
term_html.pl  -- Represent Prolog terms as HTMLShow source
blob_rendering/5Hook to render blob atoms as HTML.Source
term/4Render a Prolog term as a structured HTML tree.Source
thread_httpd.pl  -- Threaded HTTP serverShow source
websocket.pl  -- WebSocket supportShow source
yadis.pl  -- Yadis discoveryShow source