Skip to main content

Module http

Module http 

Source
Expand description

HTTP client.

(http-get URL) → body string (http-get URL HEADERS) → body string (http-get-json URL HEADERS) → parsed JSON (nested Value tree) (http-post-json URL HEADERS BODY) → parsed JSON response

HEADERS is a list of (KEY . VALUE) cons cells or (KEY VALUE) lists. Tatara-lisp’s (cons) produces a 2-element list, so both shapes work. A typical Cloudflare call:

(http-get-json “https://api.cloudflare.com/client/v4/zones?name=lilitu.io” (list (list “Authorization” (string-append “Bearer “ token)) (list “Content-Type” “application/json”)))

Functions§

install