def req.cl
import bend-kit-http@0.38.2.0/http.bend as Httpimport Base
1730# RFC 9110 §8.6: no Content-Length on a bodiless request whose method gives a body no meaning.
1731def req.cl(+m: Map<&2, List<&2, String>>, +method: String, +len: U32) -> Map<&2, List<&2, String>>:
1732 +bodied = Bool.or(Bool.not(U32.is_zero(len)), Bool.or(String.eq(method, "POST"), Bool.or(String.eq(method, "PUT"), String.eq(method, "PATCH"))))
1733 Bool.pick(Map<&2, List<&2, String>>, bodied, set(m, "content-length", U32.show(len)), m)