json
json(
response):Effect<unknown,ResponseError>
Parses a 2xx response as JSON. Check its shape yourself, for example with mira/schema.
Parameters
Section titled “Parameters”response
Section titled “response”Returns
Section titled “Returns”Effect<unknown, ResponseError>
Example
Section titled “Example”import * as Http from "mira/http";import * as S from "mira/schema";
const Release = S.object({ tag_name: S.string() });
export default function* () { const response = yield* Http.request("https://api.github.com/repos/o/r/releases/latest"); const release = yield* Release.parse(yield* Http.json(response));}