def respond.stream

emerging-ezhttp@0.22.0.0 · src/http.bend:1031

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

1031# the head of a streamed reply: chunked unless the status has no body
1032# (RFC 9112 §6.1, §7.1; SPEC.md HTTP-SRV-7)
1033def respond.stream(+status: U32, headers: List<&2, Header>) -> String:
1034  "HTTP/1.1 " ++ U32.show(status) ++ " " ++ reason(status) ++ "\r\n"
1035    ++ "Connection: close\r\n"
1036    ++ headers.lines(headers)
1037    ++ te.line(Bool.not(status.nocontent(status)))
1038    ++ "\r\n"

Uses (11)

Used by (1)