This class allows to perform access scripted REST API request details in scripts. 


body


The body of the request.


Name

Type
bodyArray

Example:

[
   'sys_id' => '1234567890',
   'name' => 'incident'
]




getHeader


Returns the value of the header specified.

NameType
getHeaderString

Example:

const acceptHeader = request.getHeader('accept');


headers


This method allows defining all request headers and their values.

NameType
headersArray

Example:

[
   'content-type' => 'Application/json'
]



queryParams


The query parameters from the request.


FieldType
queryParamsArray


Example:

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


FieldType
queryStringArray


Example:

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.

FieldType
uriString


Example:

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.


FieldType
urlString

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.