graphix-package-http 0.9.0

A dataflow language for UIs and network programming, http package
Documentation
1
2
3
4
5
6
7
8
9
10
type Client;
type Server;
let client = |#timeout: [duration, null] = null, #default_headers: Array<(string, string)> = [], #redirect_limit: u32 = u32:10, #ca_cert: [bytes, null] = null, trigger: Any| -> Result<Client, `HTTPError(string)> 'http_client;
let default_client = |trigger: Any| -> Result<Client, `HTTPError(string)> 'http_default_client;
let request = |#method: Method = `GET, #headers: Array<(string, string)> = [], #body: [string, null] = null, #timeout: [duration, null] = null, client: Client, url: string| -> Result<Response, `HTTPError(string)> 'http_request;
let request_bin = |#method: Method = `GET, #headers: Array<(string, string)> = [], #body: [bytes, null] = null, #timeout: [duration, null] = null, client: Client, url: string| -> Result<BinResponse, `HTTPError(string)> 'http_request_bin;
let get = |client: Client, url: string| -> Result<Response, `HTTPError(string)> request(client, url);
let get_bin = |client: Client, url: string| -> Result<BinResponse, `HTTPError(string)> request_bin(client, url);
let server_addr = |server: Server| -> string 'http_server_addr;
let serve = |#addr: string, #cert: [bytes, null] = null, #key: [bytes, null] = null, #max_connections: i64 = 768, #handler: fn(req: Request) -> Response throws 'e| -> Result<Server, `HTTPError(string)> throws 'e 'http_serve