JSONResponse
Overview
Remarks
Etag caching is supported when JSONResponse
is constructed with the needed parameters.
You may want to disable caching in your browser development tools to avoid this behavior while debugging.
Usage
- Node
- Deno
- Browser/ESM
import { JSONResponse } from 'keywork/http/classes'
import { JSONResponse } from 'https://deno.land/x/keywork/http/classes'
let { JSONResponse } = await import('https://esm.sh/keywork/http/classes')
Hierarchy
↳
JSONResponse
Constructors
constructor
new JSONResponse
(json, request?, etag?, cacheControlOptions?, headersInit?, pretty?)
Parameters
Name | Type | Default value | Description |
---|---|---|---|
json | Object | undefined | |
request? | Request | undefined | |
etag? | string | undefined | |
cacheControlOptions? | CacheControlDirectives | undefined | |
headersInit? | HeadersInit | undefined | |
pretty | boolean | false |
Overrides
CachableResponse.constructor
Defined in
http/classes/JSONResponse.ts:28
A response sent to the client containing a JSON object.