def respond.head.onto

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

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

999# the head of a reply whose body is n octets, onto what follows it
1000# (SPEC.md HTTP-SRV-6)
1001def respond.head.onto(+status: U32, headers: List<&2, Header>, +n: Nat,
1002  rest: String) -> String:
1003  "HTTP/1.1 " ++ U32.show(status) ++ " " ++ reason(status) ++ "\r\n"
1004    ++ "Connection: close\r\n"
1005    ++ headers.lines(headers)
1006    ++ clen.line(n, Nat.is_eq(n, 0n))
1007    ++ "\r\n"
1008    ++ rest

Uses (11)

Used by (2)