Skip to main content

JSONResponse

Overview

A response sent to the client containing a JSON object.

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

import { JSONResponse } from 'keywork/http/classes'

Hierarchy

Constructors

constructor

new JSONResponse

(json, request?, etag?, cacheControlOptions?, headersInit?, pretty?)

Parameters

NameTypeDefault valueDescription
jsonObjectundefined
request?Requestundefined
etag?stringundefined
cacheControlOptions?CacheControlDirectivesundefined
headersInit?HeadersInitundefined
prettybooleanfalse

Overrides

CachableResponse.constructor

Defined in

http/classes/JSONResponse.ts:28