Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 836 Bytes

sendGenericHttpResponse.md

File metadata and controls

29 lines (16 loc) · 836 Bytes

elections-cpl.api.hscc.bdpa.orgDocs


elections-cpl.api.hscc.bdpa.org / lib/next-api-respond / sendGenericHttpResponse

Function: sendGenericHttpResponse()

sendGenericHttpResponse(res, statusCode, responseJson?): void

Sends a generic HTTP response with the given statusCode and optional responseJson body (defaults to {}). This is the "base" function called by all other response functions.

Parameters

res: NextApiResponse

statusCode: HttpStatusCode

responseJson?: Record<string, unknown>

Returns

void

Source

lib/next-api-respond/index.ts:9