Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ghst/res.ts>HTTPResponse#json

A light-weight http framework built for Deno.
Latest
method HTTPResponse.prototype.json
import { HTTPResponse } from "https://deno.land/x/ghst@v1.1.4/res.ts";

Responds to the request with a JSON object. Use send or append instead, does the same now.

Examples

const ghst = new GhstApplication();

ghst.onRequest("/","GET",(req,res) => { res.json({ foo: "bar" }); });

Parameters

content: any

JSON object to respond with.