This class allows to perform access scripted REST API request details in scripts.
The body of the request.
Name | Type |
---|---|
body | Array |
Example:
[ 'sys_id' => '1234567890', 'name' => 'incident' ] |
getHeader
Returns the value of the header specified.
Name | Type |
---|---|
getHeader | String |
Example:
const acceptHeader = request.getHeader('accept'); |
This method allows defining all request headers and their values.
Name | Type |
---|---|
headers | Array |
Example:
[ 'content-type' => 'Application/json' ] |
The query parameters from the request.
Field | Type |
---|---|
queryParams | Array |
Example:
Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now [ 'active' => false 'name' => 'now' ] |
The entire query added to the endpoint URL
Field | Type |
---|---|
queryString | Array |
Example:
Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now [ active=false&name=now ] |
The request URI with the domain information excluded.
Field | Type |
---|---|
uri | String |
Example:
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.
Field | Type |
---|---|
url | String |
Example:
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. |