def request

cswap-bend-cli@0.1.0.0 · http.bend:199

import cswap-bend-cli@0.1.0.0/http.bend as Http
import Base

199# One request through curl (config on stdin, so the token never reaches argv),
200# with the test seam applied. Fail carries the error kind: `timeout` or
201# `network`.
202def request(method: String, url: String, hs: List<(String & String)>, body: String, +timeout_s: U32) -> IO(Result<&2, &2, String, Reply>):
203  IO.bind(String, Result<&2, &2, String, Reply>, test_base(),
204    base => IO.bind(Result<&1, &1, U32 & String, U32 & (String & String)>, Result<&2, &2, String, Reply>,
205      run(config(method, rewrite(base, url), hs, body, timeout_s), (timeout_s * 1000 + 3000 : U32)),
206      r => IO.pure(Result<&2, &2, String, Reply>, reply(r))))

Uses (16)

Used by (4)