- http
- http
- http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon
- thread_httpd.pl
- http_wrapper.pl
- http_header.pl
- http_stream.pl -- HTTP Streams
- http_exception.pl -- Map Prolog exceptions to HTTP errors
- http_path.pl -- Abstract specification of HTTP server locations
- http_dispatch.pl -- Dispatch requests in the HTTP server
- http_host.pl -- Obtain public server location
- http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests
- http_client.pl
- http_multipart_plugin.pl -- Multipart form-data plugin
- http_hook.pl -- HTTP library hooks
- html_write.pl
- html_quasiquotations.pl
- html_decl.pl
- mimetype.pl -- Determine mime-type for a file
- html_head.pl -- Automatic inclusion of CSS and scripts links
- http_server_files.pl -- Serve files needed by modules from the server
- term_html.pl -- Represent Prolog terms as HTML
- http_open.pl -- HTTP client library
- http_session.pl -- HTTP Session management
- http_openid.pl -- OpenID consumer and server library
- yadis.pl
- ax.pl -- Attribute Exchange library
- http_authenticate.pl
- http_dirindex.pl -- HTTP directory listings
- js_write.pl
- http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing
- http_server.pl -- HTTP server library
- http_dyn_workers.pl
- http_server_health.pl -- HTTP Server health statistics
- hub.pl
- websocket.pl
- http_log.pl -- HTTP Logging module
- mimepack.pl -- Create a MIME message
- http
- file_content_type(+File:atom, -ContentType:atom) is det
- file_content_type(+File:atom, ?MediaType, -ContentType:atom) is det
- True if File should be served using
ContentType:ContentType. It takes the following steps:- Determine the media type using file_mime_type/2, unless already specified using file_content_type/3.
- Determine it is a text file using text_mimetype/1
- Use the charset from the Prolog flag
default_charset
The behavior is controlled by several hooks and a flag.
- mime:mime_extension/2 defines the media type
- text_mimetype/1 defines the media type is text
- mime:charset/3 derives the charset for a file with a given media type, if the media type is text according to text_mimetype/1.
- If text_mimetype/1 succeeds and mime:charset/3 fails, the
flag
default_charsetdefines the charset unless it is set to-. The flag set by default toUTF-8if the Prolog flagencodingis set toutf8.