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 lightweight http_open.pl opens an HTTP location as a stream
- The more full-blown http_client.pl performs arbitrary HTTP requests and, depending on loaded plugins, transforms the data in a Prolog-friendly format.
The primary server-library is thread_httpd.pl, providing full-blown scalable embedded HTTP server.
Further reading
- ../../packages/http.pdf
- ../../packages/examples/http contains some demos.
- http://www.swi-prolog.org/pldoc/package/http.html
Prolog files
ax.pl -- Attribute Exchange library![]() | ||
---|---|---|
ax_alias/2 | True when Alias is an alias name for the AX schema URL. | ![]() |
ax_form_attributes/2 | True if Values is a list Alias(Value) for each exchanged attribute. | ![]() |
http_ax_attributes/2 | True when HTTPAttributes is a list of Name=Value pairs that can be used with an HTTP request to query for the attributes Spec. | ![]() |
html_head.pl -- Automatic inclusion of CSS and scripts links![]() | ||
html_current_resource/1 | True when About is a currently known resource. | ![]() |
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 quasi quotations![]() | ||
html/4 | The predicate html/4 implements HTML quasi quotations. | ![]() |
html_write.pl -- Write HTML text![]() | ||
http_authenticate.pl -- Authenticate HTTP connections using 401 headers![]() | ||
http_authenticate/3 | True if Request contains the information to continue according to Type. | ![]() |
http_authorization_data/2 | Decode the HTTP Authorization header. | ![]() |
http_current_user/3 | True when User is present in the htpasswd file File and Fields provides the additional fields. | ![]() |
http_read_passwd_file/2 | Read a password file. | ![]() |
http_write_passwd_file/2 | Write password data Data to File. | ![]() |
authenticate/3 | Plugin for library(http_dispatch) to perform basic HTTP authentication. | ![]() |
http_client.pl -- HTTP client library![]() | ||
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_dirindex.pl -- HTTP directory listings![]() | ||
http_dispatch.pl -- Dispatch requests in the HTTP server![]() | ||
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_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_json.pl -- HTTP JSON Plugin 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. | ![]() |
open_options/2 | This hook is used by the HTTP client library to define default options based on the the broken-down request-URL. | ![]() |
update_cookies/3 | Update the cookie database. | ![]() |
write_cookies/3 | Emit a Cookie: header for the current connection. | ![]() |
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. | ![]() |
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![]() | ||
openid_associate/3 | Calls openid_associate/4 as. | ![]() |
openid_associate/4 | Associate with an open-id server. | ![]() |
openid_authenticate/4 | Succeeds if Request comes from the OpenID server and confirms that User is a verified OpenID user. | ![]() |
openid_current_host/3 | Find current location of the server. | ![]() |
openid_current_url/2 | Find the public URL for Request that we can make available to our identity provider. | ![]() |
openid_grant/1 | Handle the reply from checkid_setup_server/3. | ![]() |
openid_hook/1 | Call hook on the OpenID management library. | ![]() |
openid_logged_in/1 | True if session is associated with OpenID. | ![]() |
openid_login/1 | Associate the current HTTP session with OpenID. | ![]() |
openid_login_form/4 | Create the OpenID form. | ![]() |
openid_logout/1 | Remove the association of the current session with any OpenID. | ![]() |
openid_server/2 | Realise the OpenID server. | ![]() |
openid_server/3 | True if OpenIDLogin is the typed id for OpenID verified by Server. | ![]() |
openid_user/3 | True if OpenID is a validated OpenID associated with the current session. | ![]() |
openid_verify/2 | Handle the initial login form presented to the user by the relying party (consumer). | ![]() |
http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests![]() | ||
http_path.pl -- Abstract specification of HTTP server locations![]() | ||
location/3 | Multifile hook used to specify new HTTP locations. | ![]() |
http_absolute_location/3 | Path is the HTTP location for the abstract specification Spec. | ![]() |
http_absolute_uri/2 | URI is the absolute (i.e., starting with http:// ) URI for the abstract specification Spec. | ![]() |
http_clean_location_cache/0 | HTTP locations resolved through http_absolute_location/3 are cached. | ![]() |
http_server_files.pl -- Serve files needed by modules from the server![]() | ||
http_session.pl -- HTTP Session management![]() | ||
http_ssl_plugin.pl -- SSL plugin for HTTP libraries![]() | ||
http_stream.pl -- HTTP Streams![]() | ||
http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
http_wrapper.pl -- Server processing of an HTTP request![]() | ||
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'. | ![]() |
jquery.pl -- Provide JQuery![]() | ||
js_grammar.pl -- JavaScript grammar![]() | ||
js_token/3 | Matches and classifies the next JavaScript token. | ![]() |
js_write.pl -- Utilities for including JavaScript![]() | ||
javascript/4 | Quasi quotation parser for JavaScript that allows for embedding Prolog variables to substitude identifiers in the JavaScript snippet. | ![]() |
js_arg/3 | Same as js_expression//1, but fails if Expression is invalid, where js_expression//1 raises an error. | ![]() |
js_arg_list/3 | Write javascript (function) arguments. | ![]() |
js_call/3 | Emit a call to a Javascript function. | ![]() |
js_expression/3 | Emit a single JSON argument. | ![]() |
js_new/4 | Emit a call to a Javascript object declaration. | ![]() |
js_script/3 | Generate a JavaScript script element with the given content. | ![]() |
json.pl -- Reading and writing JSON serialization![]() | ||
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_to_json/2 | Translate a Prolog application Term into a JSON object term. | ![]() |
mimepack.pl -- Create a MIME message![]() | ||
mimetype.pl -- Determine mime-type for a file![]() | ||
term_html.pl -- Represent Prolog terms as HTML![]() | ||
thread_httpd.pl -- Threaded HTTP server![]() | ||
yadis.pl -- Yadis discovery![]() | ||
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. | ![]() |
xrds_specified_location/2 | Hook that allows for specifying locations of XRDS documents. | ![]() |