def json

bend-kit-camber@0.15.0.1 · camber.bend:29

import bend-kit-camber@0.15.0.1/camber.bend as Camber
import Base
import bend-kit-http@0.38.1.1/http.bend as Http
import bend-kit-json@0.7.0.0/json.bend as Json

29# The encoder is an explicit public projection, never record reflection.
30def json(~T: Type, ~encode: T -> Json.Val, status: U32, value: T) -> Http.Res:
31  Http.Res{status, Http.set(Http.empty(), "content-type", "application/json"), Json.encode.bytes(encode(value))}

Uses (6)

Used by (1)