The CreatorCon Call for Content is officially open! Get started here.

Fetch Response details and update worknote

Ujjwal1
Tera Contributor

hi 

I am using REST method to POST. this is triggered via script include.

in outbound Http log .

Ujjwal1_0-1746194379177.png

please suggest how to fetch this message in script include.

 

Thanks

Ujjwal

8 REPLIES 8

hi @Ankur Bawiskar 
i ma not able to get this 500 error message in response( in script include). 

Thanks 

Ujjwal

@Ujjwal1 

you already got you said using

response.getBody()

Now to know the http status you can use this response.getStatusCode()

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

what I informed is 
i am getting two different response

  1. system log -> outbound https requests : here i am getting response body , which i need to show in work note
  2. getBody() in script include, this is not same as #1
var response = r.execute();
var responseBody = response.getBody(); // this gives different reponse ,not same as system log
var httpStatuscode = response.getStatusCode();​

response body in different in #1 and #2 . this is what i have informed in my 1st reply.

Please suggest.

 

Thanks

Ujjwal

@Ujjwal1 

please check with 3rd party team

Ideally if it's error code 500 then they should give some standard response body and not the body which has HTML data.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader