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 body of the request.
Name | Type | Mandatory | Default value |
---|---|---|---|
body | SimpleApiRequest object | Y | N |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const bodyValue = { "sys_id": "156950788916212912", "name": "LDAP Property" }; |
getHeader
Returns the value of the header specified.
Name | Type | Mandatory | Default value |
---|---|---|---|
getHeader | String | Y | N |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const acceptHeader = request.getHeader("accept"); |
headers
This method allows defining all request headers and their values.
Name | Type | Mandatory |
---|---|---|
headers | SimpleRequest object | Y |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const headerValue = { content-type: "application/json" }; |
queryParams
The query parameters from the request.
Field | Type | Mandatory | Default value |
---|---|---|---|
queryParams | SimpleRequest object | Y | N |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
// Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now const queryParams = { "active": false, "name": "now" }; |
queryString
The entire query added to the endpoint URL
Field | Type | Mandatory | Default value |
---|---|---|---|
queryString | SimpleApiRequest object | Y | N |
Example:
Code Block |
---|
// Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now const queryValue = { "query": "active=false&name=now" }; |
uri
The request URI with the domain information excluded.
Field | Type | Mandatory | Default value |
---|---|---|---|
uri | String | Y | N |
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 const query = request.uri; //"api/now/table/myTable" |
url
The entire request URL.
Field | Type | Mandatory | Default value |
---|---|---|---|
url | String | Y | N |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const// querySource = request.url; //"request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now" Sourceconst query = request URL: .url; //"https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now" |
Table of Contents | ||||
---|---|---|---|---|
|