Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
FieldDescription

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


body


The

request

body

.getHeaderReturns the value

of the

specific

request

header

.

headersAll request headers.queryParamsThe query parameters from the request.queryStringThe query added to the endpoint URL.uriThe entire request URL.urlThe entire request URL.


Name

Type
bodyArray

Example:

Code Block
languagexml
themeEclipse
titlebody
linenumberstrue
[
   'sys_id' => '1234567890',
   'name' => 'incident'
]




Example:

body

The body of the request.

Name

TypebodyArray

Example:

getHeader


Returns the value of the header specified.

NameType
getHeaderString

Example:

Code Block
languagejs
themeEclipse
titlegetHeader
linenumberstrue
const acceptHeader = request.getHeader('accept');


headers


This method allows defining all request headers and their values.

NameType
headersArray

Example:

Code Block
languagexml
themeEclipse
titleheaders
linenumberstrue
[
   'content-type' => 'Application/json'
]



queryParams


The query parameters from the request.


FieldType
queryParamsArray


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


FieldType
queryStringArray


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.

FieldType
uriString


Example:

Code Block
languagexml
themeEclipse
titleURI
linenumberstrue
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:

Code Block
languagexml
themeEclipse
titleURL
linenumberstrue
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
absoluteUrltrue
classfixedPosition