Http.request.fields.n: def of emerging-ezhttp@0.21.0.0 Import: import emerging-ezhttp@0.21.0.0/src/http.bend as Http Lines 625-640 of emerging-ezhttp@0.21.0.0/src/http.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&start_line=625&end_line=640 import Base # a request's header fields for a body of n octets: Host, User-Agent and # Accept (the caller's, or the default), Connection: close, the caller's other # fields, Content-Length. # A caller's Connection or Content-Length is not sent: Connection: close lets # the connection end frame the body when no Content-Length / chunked framing # applies (RFC 9112 §9.6 / §6.3), and the body's length is computed. def request.fields.n(host: String, +hs: List<&2, Header>, +n: Nat) -> List<&2, Header>: List.append(&2, Header, fields.or(fields.of(FHost{}, hs), [H{"Host", host}]), List.append(&2, Header, fields.or(fields.of(FAgent{}, hs), [H{"User-Agent", "ezhttp"}]), List.append(&2, Header, fields.or(fields.of(FAccept{}, hs), [H{"Accept", "*/*"}]), H{"Connection", "close"} <> List.append(&2, Header, fields.of(FOther{}, hs), clen.field(n, Nat.is_eq(n, 0n)))))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=Field https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=Header https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=clen.field https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=fields.of https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=fields.or