Response Module

Import

import response from 'response';

Represents the current response object. setHeader, write and setStatusCode are only available in scripts originating from a custom Route script request.

Methods

setHeader(name, value) write(data) setStatusCode(code) setCookie(name, value, options) clearCookie(name, options)

setHeader(name, value)

Arguments

  • name (String) header name

  • value (String) header value

write(data)

Arguments

  • data (String) response data.

setStatusCode(code)

Arguments

  • code (Number) the http status code.

setCookie(name, value, options)

Arguments

  • name (String) cookie name

  • value (Object) cookie value

  • options (Object)

    • signed (Boolean:false)

    • secure (Boolean:false)

    • maxAge (Number:null)

    • httpOnly (Boolean:false)

clearCookie(name, options)

Arguments

  • name (String) cookie name

  • options (Object)

    • signed (Boolean:false)

    • secure (Boolean:false)

    • maxAge (Number:null)

    • httpOnly (Boolean:false)

Last updated