- thread_httpd.pl -- Threaded HTTP server
- http_wrapper.pl -- Server processing of an HTTP request
- http_header.pl -- Handling HTTP headers
- html_write.pl -- Write HTML text
- html_quasiquotations.pl -- HTML quasi quotations
- http_dispatch.pl -- Dispatch requests in the HTTP server
- mimetype.pl -- Determine mime-type for a file
- http_path.pl -- Abstract specification of HTTP server locations
- http_host.pl -- Obtain public server location
- http_exception.pl -- Map Prolog exceptions to HTTP errors
- mimepack.pl -- Create a MIME message
- http_stream.pl -- HTTP Streams
- http_ssl_plugin.pl -- SSL plugin for HTTP libraries
- http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests
- http_client.pl -- HTTP client library
- http_open.pl -- HTTP client library
- http_multipart_plugin.pl -- Multipart form-data plugin
- http_hook.pl -- HTTP library hooks
- html_head.pl -- Automatic inclusion of CSS and scripts links
- term_html.pl -- Represent Prolog terms as HTML
- jquery.pl -- Provide JQuery
- http_server_files.pl -- Serve files needed by modules from the server
- json.pl -- Reading and writing JSON serialization
- http_session.pl -- HTTP Session management
- http_openid.pl -- OpenID consumer and server library
- yadis.pl -- Yadis discovery
- ax.pl -- Attribute Exchange library
- http_authenticate.pl -- Authenticate HTTP connections using 401 headers
- http_json.pl -- HTTP JSON Plugin module
- http_dirindex.pl -- HTTP directory listings
- http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing
- json_convert.pl -- Convert between JSON terms and Prolog application terms
- http_error.pl -- Decorate uncaught HTTP exceptions with stack-trace
- hub.pl -- Manage a hub for websockets
- websocket.pl -- WebSocket support
- http_log.pl -- HTTP Logging module
- http_handler(+Path, :Closure, +Options) is det
- Register Closure as a handler for HTTP requests. Path is a
specification as provided by
http_path.pl. If an HTTP request arrives at the server that matches Path, Closure is called with one extra argument: the parsed HTTP request. Options is a list containing the following options:
- Demand authentication. Authentication methods are
pluggable. The library
http_authenticate.plprovides a plugin for user/password based
Transfer-encoding: chunkedif the client allows for it.
- If present, the handler is ignored if Goal does not succeed.
- Specifies the content-type of the reply. This value is currently not used by this library. It enhances the reflexive capabilities of this library through http_current_handler/3.
- Identifier of the handler. The default identifier is the predicate name. Used by http_location_by_id/2.
trueon a prefix-handler (see prefix), possible children are masked. This can be used to (temporary) overrule part of the tree.
- Declare that the handler processes Method. This is
method(*)allows for all methods.
- Declare that the handler processes all of the given methods. If this option appears multiple times, the methods are combined.
- Call Pred on any location that is a specialisation of
Path. If multiple handlers match, the one with the
longest path is used. Options defined with a prefix
handler are the default options for paths that start
with this prefix. Note that the handler acts as a
fallback handler for the tree below it:
:- http_handler(/, http_404([index('index.html')]), [spawn(my_pool),prefix]).
- If two handlers handle the same path, the one with the highest priority is used. If equal, the last registered is used. Please be aware that the order of clauses in multifile predicates can change due to reloading files. The default priority is 0 (zero).
- Run the handler in a seperate thread. If SpawnOptions is an atom, it is interpreted as a thread pool name (see create_thread_pool/3). Otherwise the options are passed to http_spawn/2 and from there to thread_create/3. These options are typically used to set the stack limits.
- One of
defaultor a positive number (seconds). If
default, the value from the setting
http:time_limitis taken. The default of this setting is 300 (5 minutes). See setting/2.
Note that http_handler/3 is normally invoked as a directive and processed using term-expansion. Using term-expansion ensures proper update through make/0 when the specification is modified. We do not expand when the cross-referencer is running to ensure proper handling of the meta-call.