You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 15 Next »
This class allows to perform access scripted REST API request details in scripts.
The body of the request.
Name
Example:
const bodyValue = { "sys_id": "156950788916212912", "name": "LDAP Property" };
getHeader
Returns the value of the header specified.
const acceptHeader = request.getHeader("accept");
This method allows defining all request headers and their values.
const headerValue = { 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 const queryParams = { "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 const queryValue = { "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