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![]() | ||
html/3 | Generate HTML from Content. | ![]() |
html_begin/3 | For html_begin//1, Env is a term Env(Attributes); for html_end//1 it is the plain environment name. | ![]() |
html_current_option/1 | True if Option is an active option for the HTML generator. | ![]() |
html_end/3 | For html_begin//1, Env is a term Env(Attributes); for html_end//1 it is the plain environment name. | ![]() |
html_meta/1 | This directive can be used to declare that an HTML rendering rule takes HTML content as argument. | ![]() |
html_post/4 | Reposition HTML to the receiving Id. | ![]() |
html_print_length/2 | Determine the content length of a token list produced using html//1. | ![]() |
html_quoted/3 | Quote the value for normal (CDATA) text. | ![]() |
html_quoted_attribute/3 | Quote the value according to the rules for tag-attributes included in double-quotes. | ![]() |
html_receive/3 | Receive posted HTML tokens. | ![]() |
html_receive/4 | This 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. | ![]() |
html_root_attribute/4 | Add an attribute to the HTML root element of the page. | ![]() |
html_set_options/1 | Set options for the HTML output. | ![]() |
layout/3 | Define required newlines before and after tags. | ![]() |
page/3 | Generate a page including the HTML <!DOCTYPE> header. | ![]() |
page/4 | Generate a page including the HTML <!DOCTYPE> header. | ![]() |
print_html/1 | Print list of atoms and layout instructions. | ![]() |
print_html/2 | Print list of atoms and layout instructions. | ![]() |
reply_html_page/2 | Provide the complete reply as required by http_wrapper.pl for a page constructed from Head and Body. | ![]() |
reply_html_page/3 | Provide the complete reply as required by http_wrapper.pl for a page constructed from Head and Body. | ![]() |
xhtml_ns/4 | Demand an xmlns:id=Value in the outer html tag. | ![]() |
http_authenticate.pl -- Authenticate HTTP connections using 401 headers![]() | ||
http_client.pl -- HTTP client library![]() | ||
http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing![]() | ||
http_dirindex.pl -- HTTP directory listings![]() | ||
http_dispatch.pl -- Dispatch requests in the HTTP server![]() | ||
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_header.pl -- Handling HTTP headers![]() | ||
http_hook.pl -- HTTP library hooks![]() | ||
http_host.pl -- Obtain public server location![]() | ||
http_json.pl -- HTTP JSON Plugin module![]() | ||
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. | ![]() |
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![]() | ||
http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests![]() | ||
http_path.pl -- Abstract specification of HTTP server locations![]() | ||
http_server_files.pl -- Serve files needed by modules from the server![]() | ||
serve_files_in_directory/2 | Serve files from the directory Alias from the path-info from Request. | ![]() |
http_session.pl -- HTTP Session management![]() | ||
http_ssl_plugin.pl -- SSL plugin for HTTP libraries![]() | ||
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 sofar. | ![]() |
cgi_open/4 | Process CGI output. | ![]() |
cgi_property/2 | Inquire the status of the CGI stream. | ![]() |
cgi_set/2 | Change one of the properies. | ![]() |
cgi_statistics/1 | Return statistics on the CGI stream subsystem. | ![]() |
http_chunked_open/3 | Create a stream to realise HTTP chunked encoding or decoding. | ![]() |
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![]() | ||
hub.pl -- Manage a hub for websockets![]() | ||
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![]() | ||
json.pl -- Reading and writing JSON serialization![]() | ||
json_convert.pl -- Convert between JSON terms and Prolog application terms![]() | ||
mimepack.pl -- Create a MIME message![]() | ||
mimetype.pl -- Determine mime-type for a file![]() | ||
term_html.pl -- Represent Prolog terms as HTML![]() | ||
blob_rendering/5 | Hook to render blob atoms 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![]() |