- http
- http
- http_unix_daemon.pl -- Run SWI-Prolog HTTP server as a Unix system daemon
- thread_httpd.pl -- Threaded HTTP server
- http_wrapper.pl
- http_header.pl -- Handling HTTP headers
- http_stream.pl -- HTTP Streams
- http_exception.pl
- http_path.pl -- Abstract specification of HTTP server locations
- http_dispatch.pl -- Dispatch requests in the HTTP server
- http_host.pl
- http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests
- http_client.pl -- HTTP client library
- http_multipart_plugin.pl -- Multipart form-data plugin
- http_hook.pl -- HTTP library hooks
- html_write.pl -- Write HTML text
- html_quasiquotations.pl -- HTML quasi quotations
- 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
- json.pl -- Reading and writing JSON serialization
- http_open.pl -- HTTP client library
- 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
- js_write.pl -- Utilities for including JavaScript
- js_grammar.pl -- JavaScript grammar
- http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing
- json_convert.pl -- Convert between JSON terms and Prolog application terms
- http_server.pl -- HTTP server library
- http_dyn_workers.pl -- Dynamically schedule HTTP workers.
- http_server_health.pl -- HTTP Server health statistics
- hub.pl -- Manage a hub for websockets
- websocket.pl -- WebSocket support
- http_log.pl -- HTTP Logging module
- mimepack.pl -- Create a MIME message
- http
- mime_pack(+Inputs, +Out:stream, ?Boundary) is det
- Pack a number of inputs into a MIME package using a specified or
generated boundary. The generated boundary consists of the
current time in milliseconds since the epoch and 10 random
hexadecimal numbers. Inputs is a list of documents that is
added to the mime message. Each element is one of:
- Name = Value
- Name the document. This emits a header of the form below. The
filename
is present if Value is of the formfile(File)
. Value may be any of remaining value specifications.Content-Disposition: form-data; name="Name"[; filename="<File>"
- html(Tokens)
- Tokens is a list of HTML tokens as produced by html//1. The token list is emitted using print_html/1.
- file(File)
- Emit the contents of File. The
Content-type
is derived from the File using file_mime_type/2. If the content-type istext/_
, the file data is copied in text mode, which implies that it is read in the default encoding of the system and written using the encoding of the Out stream. Otherwise the file data is copied binary. - stream(In, Len)
- Content is the next Len units from In. Data is copied using copy_stream_data/3. Units is bytes for binary streams and characters codes for text streams.
- stream(In)
- Content of the stream In, copied using copy_stream_data/2. This is often used with memory files (see new_memory_file/1).
- mime(Attributes,Value,[])
- Create a MIME header from Attributes and add Value, which can
be any of remaining values of this list. Attributes may
contain
type(ContentType)
and/orcharacter_set(CharSet)
. This can be used to give a content-type to values that otherwise do not have a content-type. For example:mime([type(text/html)], '<b>Hello World</b>', [])
- mime([],,Parts)
- Creates a nested multipart MIME message. Parts is passed as Inputs to a recursive call to mime_pack/2.
- Atomic
- Atomic values are passed to write/1. This embeds simple atoms and numbers.
- Arguments:
-
Out - is a stream opened for writing. Typically, it should be opened in text mode using UTF-8 encoding. - bug
- - Does not validate that the boundary does not appear in any of the input documents.