Skip to main content

Class: ApiResponse

@sapphire/plugin-api.ApiResponse

since 1.0.0

Hierarchy

  • ServerResponse

    ApiResponse

Constructors

constructor

new ApiResponse(req)

Parameters

NameType
reqIncomingMessage

Inherited from

ServerResponse.constructor

Defined in

node_modules/@types/node/http.d.ts:494

Properties

cookies

cookies: CookieStore

since 1.0.0

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:13

Methods

badRequest

badRequest(data?): void

since 1.0.0

Parameters

NameType
data?unknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:42


conflict

conflict(data?): void

since 1.0.0

Parameters

NameType
data?unknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:70


created

created(data?): void

since 1.0.0

Parameters

NameType
dataunknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:26


error

error(error, data?): void

since 1.0.0

Parameters

NameType
errorstring | number
data?unknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:77


forbidden

forbidden(data?): void

since 1.0.0

Parameters

NameType
data?unknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:56


json

json(data): void

since 1.0.0

Parameters

NameType
dataany

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:103


noContent

noContent(data?): void

since 1.0.0

Parameters

NameType
dataunknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:34


notFound

notFound(data?): void

since 1.0.0

Parameters

NameType
data?unknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:63


ok

ok(data?): void

since 1.0.0

Parameters

NameType
dataunknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:18


respond

respond(data): void

since 1.0.0

Parameters

NameType
dataunknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:88


setContentType

setContentType(contentType): ApiResponse

since 1.0.0

Parameters

NameType
contentTypeMimeTypes

Returns

ApiResponse

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:117


status

status(code): ApiResponse

since 1.0.0

Parameters

NameType
codenumber

Returns

ApiResponse

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:95


text

text(data): void

since 1.0.0

Parameters

NameType
datastring

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:110


unauthorized

unauthorized(data?): void

since 1.0.0

Parameters

NameType
data?unknown

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/ApiResponse.ts:49