<?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 Re: How to uncompress (inflate) gzip REST Api response? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326609#M96079</link>
    <description>&lt;P&gt;Hi, I found a solution and here it is!&lt;/P&gt; 
&lt;P&gt;I've also opened a Jira ticket to report the issue: &lt;A href="https://jira.talendforge.org/browse/TDI-41702" target="_blank" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-41702&lt;/A&gt;, fell free to vote it up.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is a piece of Java code that inflat a GZIPed API response. For the demo I used StackExchange API which by default GZIP its reponses.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJava Advanced Settings&lt;/P&gt; 
&lt;PRE&gt;import java.util.zip.GZIPInputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.net.HttpURLConnection;
import java.net.URL;&lt;/PRE&gt; 
&lt;P&gt;tJava Basic Settings&lt;/P&gt; 
&lt;PRE&gt;// Ini API CALL
URL url = new URL("https://api.stackexchange.com/2.2/info?site=stackoverflow");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Test");

// Store ResponseCode
int status = con.getResponseCode();

// Inflat gzip stream (the API response content is gziped)
GZIPInputStream gzis = new GZIPInputStream(con.getInputStream());
InputStreamReader reader = new InputStreamReader(gzis);
BufferedReader in = new BufferedReader(reader);

// Send the output to next component, line by line
String readed;
while ((readed = in.readLine()) != null) {
//   System.out.println(readed);
	row2.content = readed;
}&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Jan 2019 16:04:45 GMT</pubDate>
    <dc:creator>Sarye</dc:creator>
    <dc:date>2019-01-27T16:04:45Z</dc:date>
    <item>
      <title>How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326605#M96075</link>
      <description>&lt;P&gt;Hi&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Would love to know how to decompress / uncompress (inflate) gzip String?&amp;nbsp; Please :&amp;nbsp;&lt;EM&gt;Without saving it as a zip file&lt;/EM&gt;.&lt;/P&gt; 
&lt;P&gt;It's&amp;nbsp;response of a rest-api call UTF-8 compressed&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Would be nice if there are some functions related to string-handling:&amp;nbsp;&lt;A title="package (doc) util.java zip " href="https://docs.oracle.com/javase/7/docs/api/java/util/zip/package-summary.html" target="_self" rel="nofollow noopener noreferrer"&gt;package (doc) util.java zip &lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;cheers + thanks!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 13:49:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326605#M96075</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-05-14T13:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326606#M96076</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LMrOAAW"&gt;@Dijke&lt;/A&gt;,you can use tFileArchive and&amp;nbsp;tFileUnarchive ,Folder to zip and unzip.&lt;/P&gt;
&lt;P&gt;please find the below links&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.talend.com/reader/iYcvdknuprDzYycT3WRU8w/4HqSCsyne6rLWociYNchDQ" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/iYcvdknuprDzYycT3WRU8w/4HqSCsyne6rLWociYNchDQ&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/7Bj99i9HHD~wcAItQuK9Zw" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/7Bj99i9HHD~wcAItQuK9Zw&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 08:28:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326606#M96076</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-05-16T08:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326607#M96077</link>
      <description>&lt;P&gt;@manodw&amp;nbsp;, sorry, but not a proper solution. very inefficient!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get a server response (gzip) -&amp;gt; (allready in memory) -&amp;gt; disk i/o-&amp;gt; fileOut -&amp;gt;&amp;nbsp; fileIn -&amp;gt; disk i/o -&amp;gt; (unzip process) -&amp;gt;&amp;nbsp; back in memory&lt;BR /&gt;&lt;SPAN&gt;should be server response (gzip) -&amp;gt; (allready in memory) -&amp;gt; decrypt bytes in memory -&amp;gt; save to db / disk i/o OR do whatever I wanna do.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 16:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326607#M96077</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-05-16T16:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326608#M96078</link>
      <description>&lt;P&gt;Hi everyone,&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="Capture.PNG" style="width: 297px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lzxi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129992i1A8FFDC815D4AFE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lzxi.png" alt="0683p000009Lzxi.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm facing exactly the same issue as &lt;A href="https://community.qlik.com/s/profile/0053p000007LMrOAAW"&gt;@Dijke&lt;/A&gt;:&lt;/P&gt; 
&lt;P&gt;- I perform an API call through tRESTClient.&lt;BR /&gt;- The server's response has the header:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; content-encoding: [gzip]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- So It's gzip compressed. The API documentation formally stipulate that clients has to activate gzip handling, because the response is always gziped.&lt;BR /&gt;- But tRESTClient's output schema has default values and the gzip content is cast as a string in the default field "string"&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="Capture_2.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0Og.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147499i4C299951DA0720BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0Og.png" alt="0683p000009M0Og.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;. As a result, I can not read the response. Here the tLogRow Output :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Does anyone has found a solution ? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:44:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326608#M96078</guid>
      <dc:creator>Sarye</dc:creator>
      <dc:date>2018-10-10T13:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326609#M96079</link>
      <description>&lt;P&gt;Hi, I found a solution and here it is!&lt;/P&gt; 
&lt;P&gt;I've also opened a Jira ticket to report the issue: &lt;A href="https://jira.talendforge.org/browse/TDI-41702" target="_blank" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-41702&lt;/A&gt;, fell free to vote it up.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is a piece of Java code that inflat a GZIPed API response. For the demo I used StackExchange API which by default GZIP its reponses.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJava Advanced Settings&lt;/P&gt; 
&lt;PRE&gt;import java.util.zip.GZIPInputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.net.HttpURLConnection;
import java.net.URL;&lt;/PRE&gt; 
&lt;P&gt;tJava Basic Settings&lt;/P&gt; 
&lt;PRE&gt;// Ini API CALL
URL url = new URL("https://api.stackexchange.com/2.2/info?site=stackoverflow");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Test");

// Store ResponseCode
int status = con.getResponseCode();

// Inflat gzip stream (the API response content is gziped)
GZIPInputStream gzis = new GZIPInputStream(con.getInputStream());
InputStreamReader reader = new InputStreamReader(gzis);
BufferedReader in = new BufferedReader(reader);

// Send the output to next component, line by line
String readed;
while ((readed = in.readLine()) != null) {
//   System.out.println(readed);
	row2.content = readed;
}&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jan 2019 16:04:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326609#M96079</guid>
      <dc:creator>Sarye</dc:creator>
      <dc:date>2019-01-27T16:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326610#M96080</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Talend 7.1.1, the tESBConsumer component supports GZIP encoding.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326610#M96080</guid>
      <dc:creator>rgagnon</dc:creator>
      <dc:date>2019-03-08T18:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to uncompress (inflate) gzip REST Api response?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326611#M96081</link>
      <description>&lt;P&gt;How do you do a REST call with a tESBConsumer?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 10:57:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-uncompress-inflate-gzip-REST-Api-response/m-p/2326611#M96081</guid>
      <dc:creator>RGriveau</dc:creator>
      <dc:date>2022-09-06T10:57:48Z</dc:date>
    </item>
  </channel>
</rss>

