def wire.heard.of

emerging-ezhttp@0.21.0.0 · src/wirespec.bend:253

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

253# the response an exchange's answer holds, read by the request's method
254# (SPEC.md HTTP-CLI-9); a failed exchange is torn with the reason it is
255# reported with (wire.why)
256def wire.heard.of(+method: String, +raw: String, ok: Bool) -> Http.Reply:
257  match ok:
258    case False{}:
259      Http.Torn{wire.failed(raw)}
260    case True{}:
261      Http.parse.to(method, wire.text(raw))

Uses (6)

Used by (1)