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_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![]() | ||
| mime_type_icon/2 | Multi-file hook predicate that can be used to associate icons to files listed by http_reply_dirindex/3. | ![]() |
| directory_index/4 | Show index for a directory. | ![]() |
| http_reply_dirindex/3 | Provide a directory listing for Request, assuming it is an index for the physical directrory Dir. | ![]() |
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_address/2 | HTML-rule that emits the location of the HTTP server. | |
| mime_type_encoding/2 | Encoding is the (default) character encoding for MimeType. | ![]() |
| status_page/3 | Hook called by http_status_reply/4 and http_status_reply/5 that allows for emitting custom error pages for the following HTTP page types:. | |
| http_join_headers/3 | Append headers from Default to Header if they are not already part of it. | ![]() |
| http_parse_header/2 | Header is a list of Name(Value)-terms representing the structure of the HTTP header in Text. | ![]() |
| http_parse_header_value/3 | Translate Value in a meaningful Prolog term. | ![]() |
| http_post_data/3 | Send data on behalf on an HTTP POST request. | ![]() |
| http_read_header/2 | Read Name: Value lines from FD until an empty line is encountered. | ![]() |
| http_read_reply_header/2 | Read the HTTP reply header. | ![]() |
| http_read_request/2 | Read an HTTP request-header from FdIn and return the broken-down request fields as +Name(+Value) pairs in a list. | ![]() |
| http_reply/2 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/3 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/4 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/5 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply/6 | Compose a complete HTTP reply from the term Data using additional headers from HdrExtra to the output stream Out. | ![]() |
| http_reply_header/3 | Create a reply header using reply_header//3 and send it to Stream. | ![]() |
| http_status_reply/4 | Emit HTML non-200 status reports. | ![]() |
| http_status_reply/5 | Emit HTML non-200 status reports. | ![]() |
| http_timestamp/2 | Generate a description of a Time in HTTP format (RFC1123). | ![]() |
| http_update_connection/4 | Merge keep-alive information from Request and CGIHeader into Header. | ![]() |
| http_update_encoding/3 | Allow for rewrite of the header, adjusting the encoding. | ![]() |
| http_update_transfer/4 | Decide on the transfer encoding from the Request and the CGI header. | ![]() |
http_hook.pl -- HTTP library hooks![]() | ||
http_host.pl -- Obtain public server location![]() | ||
http_json.pl -- HTTP JSON Plugin module![]() | ||
http_multipart_plugin.pl -- Multipart form-data plugin![]() | ||
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![]() | ||
| 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![]() | ||
http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon![]() | ||
http_wrapper.pl -- Server processing of an HTTP request![]() | ||
jquery.pl -- Provide JQuery![]() | ||
js_grammar.pl -- JavaScript grammar![]() | ||
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![]() | ||
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![]() | ||
