Skip to content

Context

Context object is used to store and manage properties for a single execution flow (with or without HTTP request)

Basic Usage

import { context } from "sdk/core";
import { response } from "sdk/http";

context.set("attr1", "value1");
let attr = context.get("attr1");

response.println("[Attribute]: " + attr);
response.flush();
response.close();

Functions


Function Description Returns
get(key) Returns the value per key from the context parameters string
set(key, value) Sets the value per key to the context parameters -