Unable to get header parameters for a GET request

Amit Kumar21
Tera Contributor

I am trying to get a token value form the header parameter of a GET request. But when i try that from 'Test' related link of the HTTP method of REST message, i get this error in 'Response' and nothing in parameters.

AmitKumar21_0-1700120129807.png

 

Also when i try calling the request and method using background script and print the response, i see the same error. Using script when i try to print the header i get 'null'.

screenshot of REST message:

AmitKumar21_1-1700122086961.png

 

screenshot of HTTP method:

AmitKumar21_2-1700122276046.png

 

screenshot of the script and its result:

AmitKumar21_3-1700122461561.png

 

Can anyone please help in getting the response or point in direction where/how that can be done in ServiceNow.

 

1 REPLY 1

Niklas Peterson
Mega Sage

Hi,

The error says that your API Endpoint is not supporting GET. Not all endpoint support all methods. You need to use a method that is compatible with the endpoint.

 

Regards,
Niklas