<?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>topic How to allow user to select JSON or XML response from tRESTRequest in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309892#M81071</link>
    <description>Can anyone explain to me how to get the tRESTRequest component to allow the user to specify whether to return either JSON or XML? &amp;nbsp;I can get my service to return JSON by setting "Produces=JSON" and it returns XML by setting "Produces=XML". &amp;nbsp;However, when I set "Produces=XML or JSON", I am only able to get XML response.&lt;BR /&gt;I should add that I am accessing this from my browser (Chrome). &amp;nbsp;So for example, I am going to http://localhost:8088/customers and I would like to know whether it is possible to add something to the end of that URL which would tell the service whether to return XML or JSON. &amp;nbsp;Is it possible to do this through the URL?&lt;BR /&gt;Thanks.</description>
    <pubDate>Sun, 28 Sep 2014 22:45:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-09-28T22:45:57Z</dc:date>
    <item>
      <title>How to allow user to select JSON or XML response from tRESTRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309892#M81071</link>
      <description>Can anyone explain to me how to get the tRESTRequest component to allow the user to specify whether to return either JSON or XML? &amp;nbsp;I can get my service to return JSON by setting "Produces=JSON" and it returns XML by setting "Produces=XML". &amp;nbsp;However, when I set "Produces=XML or JSON", I am only able to get XML response.&lt;BR /&gt;I should add that I am accessing this from my browser (Chrome). &amp;nbsp;So for example, I am going to http://localhost:8088/customers and I would like to know whether it is possible to add something to the end of that URL which would tell the service whether to return XML or JSON. &amp;nbsp;Is it possible to do this through the URL?&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 28 Sep 2014 22:45:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309892#M81071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-28T22:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow user to select JSON or XML response from tRESTRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309893#M81072</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;If you use tRestClient to call the webservice &amp;nbsp;and select Accept type as 'JSON' on tRestClient, it will return json response.
&lt;BR /&gt;
&lt;PRE&gt;ID: 1&lt;BR /&gt;Response-Code: 200&lt;BR /&gt;Encoding: ISO-8859-1&lt;BR /&gt;Content-Type: application/json&lt;BR /&gt;Headers: {content-type=, Date=, Server=, transfer-encoding=}&lt;BR /&gt;Payload: {"root":{"person":}}&lt;/PRE&gt;
&lt;BR /&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 29 Sep 2014 09:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309893#M81072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-29T09:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow user to select JSON or XML response from tRESTRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309894#M81073</link>
      <description>Shong, 
&lt;BR /&gt;I tried your suggestion but it does not appear to be working as expected. &amp;nbsp;I selected "JSON" form the "Accept Type" dropdown and I still get XML. &amp;nbsp;I also set the header of "Accept" and "application/json" and I still get XML. &amp;nbsp;Next, I discovered that if you set the value of "Accept Type" to "Any" and specify a header of "Accept" = "application/json", then you get JSON, but you can't get JSON if you select "JSON" from the dropdown. 
&lt;BR /&gt;I have attached screenshots showing the following: 
&lt;BR /&gt;1. Select "Accept Type=JSON" and set header of "Accept = application/json". &amp;nbsp;Output is XML. 
&lt;BR /&gt;2. Change "Accept Type=Any" and leave the same header. &amp;nbsp;Output is JSON. 
&lt;BR /&gt;Am I doing something wrong that is causing me to be unable to get JSON output when I select JSON from the dropdown? 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB46.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142908iA87C8F19A7A22BCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB46.png" alt="0683p000009MB46.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAag.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156074iD2C394A09C018D9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAag.png" alt="0683p000009MAag.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MArr.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141437i5107CBA7E6695FBB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MArr.png" alt="0683p000009MArr.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB4B.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138411iCAAF59EB772B859B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB4B.png" alt="0683p000009MB4B.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MB4G.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152480i25680461072C80E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MB4G.png" alt="0683p000009MB4G.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 29 Sep 2014 12:36:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309894#M81073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-29T12:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow user to select JSON or XML response from tRESTRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309895#M81074</link>
      <description>&lt;P&gt;I have the same issue, Did you got any solution for this. I have also set to accept and and Accept header as JSON but all I'm getting is an xml result&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 09:44:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309895#M81074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-31T09:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow user to select JSON or XML response from tRESTRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309896#M81075</link>
      <description>I’m working on the same now where the output is always xml even when I specify the accept type as JSON. Is there are solution to this?</description>
      <pubDate>Tue, 28 Apr 2020 14:49:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-allow-user-to-select-JSON-or-XML-response-from/m-p/2309896#M81075</guid>
      <dc:creator>Gwyn</dc:creator>
      <dc:date>2020-04-28T14:49:39Z</dc:date>
    </item>
  </channel>
</rss>

