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