<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Need Json response but I'm getting XML response from Scripted REST Resource in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264747#M915851</link>
    <description>&lt;P&gt;download the boomerang, its chrome extension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title=" https://chrome.google.com/webstore/detail/boomerang-soap-rest-clien/eipdnjedkpcnlmmdfdkgfpljanehloah?hl=en"&gt;https://chrome.google.com/webstore/detail/boomerang-soap-rest-clien/eipdnjedkpcnlmmdfdkgfpljanehloah?hl=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am not sure why dont you write the code in background script. it will be more easy way to test your scripted api. is there any specific business need to test it on browser?&lt;/P&gt;</description>
    <pubDate>Sat, 20 Oct 2018 12:53:22 GMT</pubDate>
    <dc:creator>hvrdhn88</dc:creator>
    <dc:date>2018-10-20T12:53:22Z</dc:date>
    <item>
      <title>Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264737#M915841</link>
      <description>&lt;P&gt;Code Written in&amp;nbsp;&amp;nbsp;Scripted REST Resource&lt;/P&gt;
&lt;P&gt;(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; return 'xyz';&lt;BR /&gt;})(request, response);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;response in web browser in Xml&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;response&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="collapsible-content"&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;result&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="text"&gt;"yogi"&lt;/SPAN&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/result&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/response&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;How to get Json response&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:18:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264737#M915841</guid>
      <dc:creator>Ramesh68</dc:creator>
      <dc:date>2018-10-20T12:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264738#M915842</link>
      <description>&lt;P&gt;what have you set in "accept" and "content-type"?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:19:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264738#M915842</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2018-10-20T12:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264739#M915843</link>
      <description>&lt;P&gt;where I need to set accept and content-type?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:21:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264739#M915843</guid>
      <dc:creator>Ramesh68</dc:creator>
      <dc:date>2018-10-20T12:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264740#M915844</link>
      <description>&lt;P&gt;please check this on your scripted rest api&lt;/P&gt;
&lt;DIV id="label.sys_ws_operation.produces" class="" style="box-sizing: border-box; color: #343d47; font-family: SourceSansPro, 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;LABEL class=" col-xs-12 col-md-3 col-lg-4 control-label" style="box-sizing: border-box; display: inline-block; max-width: 100%; margin-bottom: 0px; font-weight: normal; position: relative; min-height: 1px; padding-left: 0px; padding-right: 0px; float: left; width: 127.75px; text-align: right; padding-top: 7px;" for="sys_readonly.sys_ws_operation.produces"&gt;&lt;SPAN class="label-text" style="box-sizing: border-box;" title=""&gt;Supported response formats&lt;/SPAN&gt;&lt;/LABEL&gt;&lt;/DIV&gt;
&lt;DIV class="col-xs-10 col-sm-9 col-md-6 col-lg-5 form-field input_controls" style="box-sizing: border-box; position: relative; min-height: 32px; padding-left: 15px; padding-right: 0px; float: left; width: 255.5px; color: #343d47; font-family: SourceSansPro, 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;INPUT id="sys_readonly.sys_ws_operation.produces" class="form-control disabled " style="box-sizing: border-box; vertical-align: middle; text-transform: none; color: #444444; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 13px; line-height: 1.42857; font-family: inherit; margin: 0px 6px 0px 0px; display: block; width: 240.5px; height: 32px; padding: 6px 9px; background-color: #e6e8ea; background-image: none; border: 1px solid #bdc0c4; border-radius: 3px; box-shadow: rgba(0, 0, 0, 0.075) 0px 1px 1px inset; transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s; cursor: not-allowed; opacity: 1;" readonly="readonly" type="text" /&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:22:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264740#M915844</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2018-10-20T12:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264741#M915845</link>
      <description>&lt;P&gt;the value should be like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;application/json,application/xml,text/xml&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;once it will be there then write the below script and check the log again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var parser = new global.JSON();&lt;BR /&gt;var body = parser.decode(request.body.dataString);&lt;BR /&gt;&lt;BR /&gt;gs.log('Stringified Body: ' + global.JSUtil.describeObject(body));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let me know what are you getting in log&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:25:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264741#M915845</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2018-10-20T12:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264742#M915846</link>
      <description>&lt;P&gt;that will be useful in Rest API Explorer but I need it in Common browser to Test&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:25:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264742#M915846</guid>
      <dc:creator>Ramesh68</dc:creator>
      <dc:date>2018-10-20T12:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264743#M915847</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/79787iC90E71843B8D891C/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:31:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264743#M915847</guid>
      <dc:creator>Ramesh68</dc:creator>
      <dc:date>2018-10-20T12:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264744#M915848</link>
      <description>&lt;P&gt;in browser it will show the xml.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can use the link below for the test in background script as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/kingston-application-development/page/integrate/custom-web-services/reference/r_ScriptedRESTServiceScriptExamples.html" rel="nofollow"&gt;https://docs.servicenow.com/bundle/kingston-application-development/page/integrate/custom-web-services/reference/r_ScriptedRESTServiceScriptExamples.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:40:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264744#M915848</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2018-10-20T12:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264745#M915849</link>
      <description>&lt;P&gt;Hi Ramesh,&lt;/P&gt;
&lt;P&gt;You can use postman tool an extension for chrome to test your scripted rest api. if you give accept as application/json it will return response in json format&lt;/P&gt;
&lt;P&gt;Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.&lt;BR /&gt;Thanks&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:42:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264745#M915849</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2018-10-20T12:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264746#M915850</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Im getiing Xml format data in chrome by default&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/79786i44639D18A9BAEE4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:44:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264746#M915850</guid>
      <dc:creator>Ramesh68</dc:creator>
      <dc:date>2018-10-20T12:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264747#M915851</link>
      <description>&lt;P&gt;download the boomerang, its chrome extension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title=" https://chrome.google.com/webstore/detail/boomerang-soap-rest-clien/eipdnjedkpcnlmmdfdkgfpljanehloah?hl=en"&gt;https://chrome.google.com/webstore/detail/boomerang-soap-rest-clien/eipdnjedkpcnlmmdfdkgfpljanehloah?hl=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am not sure why dont you write the code in background script. it will be more easy way to test your scripted api. is there any specific business need to test it on browser?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:53:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264747#M915851</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2018-10-20T12:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need Json response but I'm getting XML response from Scripted REST Resource</title>
      <link>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264748#M915852</link>
      <description>&lt;P&gt;anyway if you really need to get the result on browser then pass that url as end point in rest message&lt;/P&gt;
&lt;P&gt;you need to create rest message and pass the url in endpoint and it will show you the JSON&lt;/P&gt;
&lt;P&gt;attaching the thread below will help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/community?id=community_blog&amp;amp;sys_id=209ceae1dbd0dbc01dcaf3231f961933" rel="nofollow"&gt;https://community.servicenow.com/community?id=community_blog&amp;amp;sys_id=209ceae1dbd0dbc01dcaf3231f961933&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 12:57:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-json-response-but-i-m-getting-xml-response-from-scripted/m-p/2264748#M915852</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2018-10-20T12:57:45Z</dc:date>
    </item>
  </channel>
</rss>

