libraryextensions/http/lib/Http.xtl
Http.xtl -- the facade of the http extension: bounded HTTP GET, text from the web within size, time and redirect limits. Import: "ht:" u_se< "Http" Limits: XETAL_HTTP_MAX bytes (16 MiB), XETAL_HTTP_TIMEOUT seconds (30), 5 redirects; only http:// and https:// URLs. Downloads go under the working directory (or XETAL_HTTP_ROOT). Run with xetal-x (xetal-x --ext DIR puts this directory on XETAL_PATH). Each signature line is written out by the binding macro (lib/Ffi.xtlm).
ˡg̲et : Char -> Char
ht:g_et url: the body as text; a status other than 2xx is an error.
"g_et : text -> text" ᶠᶠⁱb̲ind< "http/get"
ˡs̲tatus : Unit -> Int
ht:s_tatus @: the last response's status (0 if none came).
"s_tatus : unit -> int" ᶠᶠⁱb̲ind< "http/status"
ˡh̲eader : Char -> Char
ht:h_eader "content-type": a header of the last response ("" if absent).
"h_eader : text -> text" ᶠᶠⁱb̲ind< "http/header"
ˡs̲ave! : Char -> Char -> Int
url ht:s_ave! "data/x.csv": the body into a file (whole, or not at all); how many bytes.
"s_ave! : text text -> int" ᶠᶠⁱb̲ind< "http/save"