http Module

download

str1 str2

Downloads the contents of URL str1 to the local file str2.

get-content

str1 str2

Retrieves the contents of URL str1 as str2.

request

dict dict:http-response

Performs an HTTP request. Note that dict is can be a standard (untyped) dictionary but its fields will be validated like if it was a dict:http-request.

start-server

dict

Starts an HTTP server based on the configuration provided in dict.

dict is a dictionary containing the following keys:

address
The address to bind the server to (default: 127.0.0.1).
port
The port to bind the server to.
handler
A quotation with the following signature, used to handle all incoming requests: dict:http-requestdict:http-response

stop-server

Stops the currently-running HTTP server. This operator should be used within an HTTP server handler quotation.