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![]() | ||
---|---|---|
html_head.pl -- Automatic inclusion of CSS and scripts links![]() | ||
html_quasiquotations.pl -- HTML quasi quotations![]() | ||
html_write.pl -- Write HTML text![]() | ||
http_authenticate.pl -- Authenticate HTTP connections using 401 headers![]() | ||
http_client.pl -- HTTP client library![]() | ||
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_cors.pl -- Enable CORS: Cross-Origin Resource Sharing![]() | ||
http_dirindex.pl -- HTTP directory listings![]() | ||
http_dispatch.pl -- Dispatch requests in the HTTP server![]() | ||
http_404/2 | Reply using an "HTTP 404 not found" page. | ![]() |
http_current_handler/2 | True if Location is handled by Closure. | ![]() |
http_current_handler/3 | Resolve the current handler and options to execute it. | ![]() |
http_delete_handler/1 | Delete handler for Spec. | ![]() |
http_dispatch/1 | Dispatch a Request using http_handler/3 registrations. | ![]() |
http_handler/3 | Register Closure as a handler for HTTP requests. | ![]() |
http_link_to_id/3 | HREF is a link on the local server to a handler with given ID, passing the given Parameters. | ![]() |
http_location_by_id/2 | Find the HTTP Location of handler with ID. | ![]() |
http_redirect/3 | Redirect to a new location. | ![]() |
http_reload_with_parameters/3 | Create a request on the current handler with replaced search parameters. | ![]() |
http_reply_file/3 | Options is a list of. | ![]() |
http_safe_file/2 | True if FileSpec is considered safe. | ![]() |
http_switch_protocol/2 | Send an "HTTP 101 Switching Protocols" reply. | ![]() |
http_error.pl -- Decorate uncaught HTTP exceptions with stack-trace![]() | ||
http_exception.pl -- Map Prolog exceptions to HTTP errors![]() | ||
http_header.pl -- Handling HTTP headers![]() | ||
http_hook.pl -- HTTP library hooks![]() | ||
convert_parameter/3 | Hook to execute a step in the HTTP parameter conversion process. | |
http_connection_over_proxy/6 | Try to connect to the host Endpoint via Proxy for the purposes of retrieving the resource identified by URLParts. | ![]() |
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_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![]() | ||
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![]() | ||
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_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_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![]() | ||
mime_extension/2 | Hook that is called by file_mime_type/2 before the default table is examined. | ![]() |
file_mime_type/2 | True when MimeType is the mime-type to be used for sending FileName. | ![]() |
term_html.pl -- Represent Prolog terms as HTML![]() | ||
thread_httpd.pl -- Threaded HTTP server![]() | ||
websocket.pl -- WebSocket support![]() | ||
http_open_websocket/3 | Establish a client websocket connection. | ![]() |
http_upgrade_to_websocket/3 | Create a websocket connection running call(Goal, WebSocket) , where WebSocket is a socket-pair. | ![]() |
ws_close/3 | Close a WebSocket connection by sending a close message if this was not already sent and wait for the close reply. | ![]() |
ws_open/3 | Turn a raw TCP/IP (or any other binary stream) into a websocket stream. | ![]() |
ws_property/2 | True if Property is a property WebSocket. | ![]() |
ws_receive/2 | Receive the next message from WebSocket. | ![]() |
ws_receive/3 | Receive the next message from WebSocket. | ![]() |
ws_send/2 | Send a message over a websocket. | ![]() |
yadis.pl -- Yadis discovery![]() |