- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 05:18 AM
Code Written in Scripted REST Resource
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
return 'xyz';
})(request, response);
response in web browser in Xml
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 05:57 AM
anyway if you really need to get the result on browser then pass that url as end point in rest message
you need to create rest message and pass the url in endpoint and it will show you the JSON
attaching the thread below will help you.
https://community.servicenow.com/community?id=community_blog&sys_id=209ceae1dbd0dbc01dcaf3231f961933

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 05:19 AM
what have you set in "accept" and "content-type"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 05:21 AM
where I need to set accept and content-type?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 05:22 AM
please check this on your scripted rest api

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 05:25 AM
the value should be like
application/json,application/xml,text/xml
once it will be there then write the below script and check the log again.
var parser = new global.JSON();
var body = parser.decode(request.body.dataString);
gs.log('Stringified Body: ' + global.JSUtil.describeObject(body));
let me know what are you getting in log