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
http_authenticate.pl  -- Authenticate HTTP connections using 401 headersShow source
http_authenticate/3True if Request contains the information to continue according to Type.Source
http_authorization_data/2Decode the HTTP Authorization header.Source
http_current_user/3True when User is present in the htpasswd file File and Fields provides the additional fields.Source
http_read_passwd_file/2Read a password file.Source
http_write_passwd_file/2Write password data Data to File.Source
authenticate/3Plugin for library(http_dispatch) to perform basic HTTP authentication.Source
http_client.pl  -- HTTP client libraryShow source
http_cors.pl  -- Enable CORS: Cross-Origin Resource SharingShow source
cors_enable/0Emit the HTTP header Access-Control-Allow-Origin using domains from the setting http:cors.Source
cors_enable/2CORS reply to a Preflight OPTIONS request.Source
http_dirindex.pl  -- HTTP directory listingsShow source
http_dispatch.pl  -- Dispatch requests in the HTTP serverShow source
http_exception.pl  -- Map Prolog exceptions to HTTP errorsShow source
http_header.pl  -- Handling HTTP headersShow source
http_hook.pl  -- HTTP library hooksShow source
http_host.pl  -- Obtain public server locationShow source
http_current_host/4Source
http_public_host/4Current global host and port of the HTTP server.Source
http_public_host_url/2True when URL is the public URL at which this server can be contacted.Source
http_public_url/2True when URL is an absolute URL for the current request.Source
http_json.pl  -- HTTP JSON Plugin 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
openid_associate/3Calls openid_associate/4 as.Source
openid_associate/4Associate with an open-id server.Source
openid_authenticate/4Succeeds if Request comes from the OpenID server and confirms that User is a verified OpenID user.Source
openid_current_host/3Find current location of the server.Source
openid_current_url/2Find the public URL for Request that we can make available to our identity provider.Source
openid_grant/1Handle the reply from checkid_setup_server/3.Source
openid_hook/1Call hook on the OpenID management library.Source
openid_logged_in/1True if session is associated with OpenID.Source
openid_login/1Associate the current HTTP session with OpenID.Source
openid_login_form/4Create the OpenID form.Source
openid_logout/1Remove the association of the current session with any OpenID.Source
openid_server/2Realise the OpenID server.Source
openid_server/3True if OpenIDLogin is the typed id for OpenID verified by Server.Source
openid_user/3True if OpenID is a validated OpenID associated with the current session.Source
openid_verify/2Handle the initial login form presented to the user by the relying party (consumer).Source
http_parameters.pl  -- Extract parameters (GET and POST) from HTTP requestsShow source
http_path.pl  -- Abstract specification of HTTP server locationsShow source
location/3Multifile hook used to specify new HTTP locations.Source
http_absolute_location/3Path is the HTTP location for the abstract specification Spec.Source
http_absolute_uri/2URI is the absolute (i.e., starting with http://) URI for the abstract specification Spec.Source
http_clean_location_cache/0HTTP locations resolved through http_absolute_location/3 are cached.Source
http_server_files.pl  -- Serve files needed by modules from the serverShow source
http_session.pl  -- HTTP Session managementShow source
http_ssl_plugin.pl  -- SSL plugin for HTTP librariesShow source
http_stream.pl  -- HTTP StreamsShow 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
http_current_request/1Returns the HTTP request currently being processed.Source
http_peer/2True when PeerIP is the IP address of the connection peer.Source
http_relative_path/2Convert an absolute path (without host, fragment or search) into a path relative to the current page.Source
http_send_header/1This API provides an alternative for writing the header field as a CGI header.Source
http_spawned/1Internal use only.Source
http_wrap_spawned/3Internal use only.Source
http_wrapper/5Simple wrapper to read and decode an HTTP header from `In', call :Goal while watching for exceptions and send the result to the stream `Out'.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
javascript/4Quasi quotation parser for JavaScript that allows for embedding Prolog variables to substitude identifiers in the JavaScript snippet.Source
js_arg/3Same as js_expression//1, but fails if Expression is invalid, where js_expression//1 raises an error.Source
js_arg_list/3Write javascript (function) arguments.Source
js_call/3Emit a call to a Javascript function.Source
js_expression/3Emit a single JSON argument.Source
js_new/4Emit a call to a Javascript object declaration.Source
js_script/3Generate a JavaScript script element with the given content.Source
json.pl  -- Reading and writing JSON serializationShow source
json_convert.pl  -- Convert between JSON terms and Prolog application termsShow source
current_json_object/3Multifile predicate computed from the json_object/1 declarations.Source
json_object/1Declare a JSON object.Source
json_to_prolog/2Translate a JSON term into an application term.Source
prolog_to_json/2Translate a Prolog application Term into a JSON object term.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
thread_httpd.pl  -- Threaded HTTP serverShow source
yadis.pl  -- Yadis discoveryShow source
xrds_dom/2True when XRDS_DOM is a parsed XML document for the given resource.Source
xrds_location/2Discover the location of the XRDS document from the given Id.Source
xrds_specified_location/2Hook that allows for specifying locations of XRDS documents.Source