You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 13 Next »
This class allows to perform access scripted REST API request details in scripts.
The body of the request.
Name
Example:
let sbody = { sys_id: "1234567890", name: "incident" };
getHeader
Returns the value of the header specified.
const acceptHeader = request.getHeader('accept');
This method allows defining all request headers and their values.
let sheader = { content-type: "Application/json" };
The query parameters from the request.
// Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now let pquery = { active: "false", name: "now" };
The entire query added to the endpoint URL
// Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now let qstring = { query: "active=false&name=now" };
The request URI with the domain information excluded.
const query = request.uri; //"api/now/table/myTable" Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now.
The entire request URL.
const query = request.url; //"https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now" Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now.