Http.config: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/http.bend as Http Lines 49-59 of cswap-bend-cli@0.1.0.0/http.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/http.bend&start_line=49&end_line=59 import Base # curl config for one request. `dump-header = -` puts the response headers on # stdout ahead of the body; `write-out` appends the HTTP status as the last # line. An empty body sends no data line (a GET stays a GET). def config(method: String, url: String, hs: List<(String & String)>, body: String, timeout_s: U32) -> String: line("url", url) ++ line("request", method) ++ "silent\nshow-error\ndump-header = -\n" ++ line("max-time", U32.show(timeout_s)) ++ line("write-out", "\\n%{http_code}") ++ headers(hs) ++ body.line(body) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.show https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/http.bend&name=body.line https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/http.bend&name=headers https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/http.bend&name=line