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![]() | ||
| 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_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_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_json.pl -- HTTP JSON Plugin module![]() | ||
| post_data_hook/3 | Hook implementation that allows http_post_data/3 posting JSON objects using one of the forms below. | ![]() |
| http_convert_data/4 | Hook implementation that supports reading JSON documents. | ![]() |
| http_read_json/2 | Extract JSON data posted to this HTTP request. | ![]() |
| http_read_json/3 | Extract JSON data posted to this HTTP request. | ![]() |
| http_read_json_dict/2 | Similar to http_read_json/2,3, but by default uses the version 7 extended datatypes. | ![]() |
| http_read_json_dict/3 | Similar to http_read_json/2,3, but by default uses the version 7 extended datatypes. | ![]() |
| json_type/1 | True if MediaType is a JSON media type. | ![]() |
| reply_json/1 | Formulate a JSON HTTP reply. | ![]() |
| reply_json/2 | Formulate a JSON HTTP reply. | ![]() |
| reply_json_dict/1 | As reply_json/1 and reply_json/2, but assumes the new dict based data representation. | ![]() |
| reply_json_dict/2 | As reply_json/1 and reply_json/2, but assumes the new dict based data representation. | ![]() |
http_log.pl -- HTTP Logging module![]() | ||
http_multipart_plugin.pl -- Multipart form-data plugin![]() | ||
| http_convert_data/4 | Convert multipart/form-data messages for http_read_data/3. | ![]() |
http_open.pl -- HTTP client library![]() | ||
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![]() | ||
| 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'. | ![]() |
hub.pl -- Manage a hub for websockets![]() | ||
| current_hub/2 | True when there exists a hub Hub with Name. | ![]() |
| hub_add/3 | Add a WebSocket to the hub. | ![]() |
| hub_broadcast/2 | Send Message to all websockets associated with Hub for which call(Condition, Id) succeeds. | ![]() |
| hub_broadcast/3 | Send Message to all websockets associated with Hub for which call(Condition, Id) succeeds. | ![]() |
| hub_create/3 | Create a new hub. | ![]() |
| hub_send/2 | Send message to the indicated ClientId. | ![]() |
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![]() | ||
| mime_pack/3 | Pack a number of inputs into a MIME package using a specified or generated boundary. | ![]() |
mimetype.pl -- Determine mime-type for a file![]() | ||
term_html.pl -- Represent Prolog terms as HTML![]() | ||
thread_httpd.pl -- Threaded HTTP server![]() | ||
websocket.pl -- WebSocket support![]() | ||
yadis.pl -- Yadis discovery![]() | ||
