You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

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

body


The body of the request.


Name

TypeMandatoryDefault value 
bodySimpleApiRequest objectYN

Example:

body
const bodyValue = {
    "sys_id": "156950788916212912",
    "name": "LDAP Property"
};

getHeader


Returns the value of the header specified.

NameTypeMandatoryDefault value
getHeaderStringYN

Example:

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

headers


This method allows defining all request headers and their values.

NameTypeMandatory
headersSimpleRequest objectY

Example:

headers
const headerValue = {
   content-type: "application/json"
};

queryParams


The query parameters from the request.

FieldTypeMandatoryDefault value
queryParamsSimpleRequest objectYN

Example:

queryParams
// 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

FieldTypeMandatoryDefault value
queryStringSimpleApiRequest objectYN

Example:

// 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.

FieldTypeMandatoryDefault value
uriStringYN


Example:

URI
// 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.


FieldTypeMandatoryDefault value
urlStringYN

Example:

URL
// Source request URL: https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now
const query = request.url; //"https://instance.simpleone.ru/api/now/table/myTable?active=false&name=now"

  • No labels