def clen.field

emerging-ezhttp@0.21.0.0 · src/http.bend:503

import emerging-ezhttp@0.21.0.0/src/http.bend as Http
import Base

503# the Content-Length field when the body is not empty (RFC 9110 §8.6)
504def clen.field(+n: Nat, empty: Bool) -> List<&2, Header>:
505  match empty:
506    case True{}:
507      []
508    case False{}:
509      [H{"Content-Length", Nat.show(n)}]

Uses (5)

Used by (2)