// http.vr — HTTP client (part of the VuurRaaf stdlib). // // import http // let res = http.get("https://api.example.com/status") // println(str(res.status)) // println(res.body) // // http.get / http.post return a struct with `status` (int) and `body` // (string). Network failures (DNS, refused, timeout) throw, so they can be // caught with try/catch; HTTP-level errors (404, 500) are normal responses. fn get(url) { return http_get(url) } fn post(url, data) { return http_post(url, data) } // get_text returns just the response body as a string. fn get_text(url) { return http_get(url).body }