Skip to main content

Class: abstract VrameworkResponse

Abstract class representing a vramework response.

Constructors

new VrameworkResponse()

new VrameworkResponse(): VrameworkResponse

Returns

VrameworkResponse

Methods

clearCookie()

clearCookie(name): void

Clears a cookie from the response.

Parameters

name: string

The name of the cookie to clear.

Returns

void

Defined in

packages/core/src/vramework-response.ts:60


end()

end(): void

Informs the response that it has ended, useful for when setting a status without a body or response.

Returns

void

Defined in

packages/core/src/vramework-response.ts:77


setCookie()

setCookie(
name,
value,
options): void

Sets a cookie for the response.

Parameters

name: string

The name of the cookie.

value: string

The value of the cookie.

options: SerializeOptions

Options for cookie serialization.

Returns

void

Defined in

packages/core/src/vramework-response.ts:52


setHeader()

setHeader(name, value): void

Sets a header for the response.

Parameters

name: string

The name of the header.

value: string | boolean | string[]

The value of the header, which can be a string, boolean, or an array of strings.

Returns

void

Defined in

packages/core/src/vramework-response.ts:32


setHeaders()

setHeaders(headers): void

Sets multiple headers for the response.

Parameters

headers: Record<string, string>

An object containing header names and values.

Returns

void

Defined in

packages/core/src/vramework-response.ts:40


setJson()

abstract setJson(body): void

Sets the JSON body for the response.

Parameters

body: JSONValue

The JSON body to set.

Returns

void

Defined in

packages/core/src/vramework-response.ts:19


setRedirect()

setRedirect(path, status): void

Sets a redirect for the response.

Parameters

path: string

The path to redirect to.

status: number

The HTTP status code for the redirect.

Returns

void

Defined in

packages/core/src/vramework-response.ts:69


setResponse()

abstract setResponse(response): void

Sets the response content.

Parameters

response: string | Buffer

The response content, which can be a string or a Buffer.

Returns

void

Defined in

packages/core/src/vramework-response.ts:25


setStatus()

abstract setStatus(status): void

Sets the HTTP status code for the response.

Parameters

status: number

The HTTP status code to set.

Returns

void

Defined in

packages/core/src/vramework-response.ts:13