Search…
Response Module
Import
1
import response from 'response';
Copied!
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)

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 modified 2mo ago