<?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: Http headers print with trest client in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222841#M16281</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN class="UserName lia-user-name lia-user-rank-Moderator lia-component-message-view-widget-author-username"&gt;&lt;SPAN&gt;&amp;nbsp;for the code.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;//access to global headers
java.util.Map resp_headers = (java.util.Map&amp;lt;String,java.util.List&amp;lt;String&amp;gt;&amp;gt;)globalMap.get("tRESTClient_1_HEADERS");

//iterate through the list of headers
System.out.println("\nResponse Headers list:");
for(String headerName: (java.util.Set&amp;lt;String&amp;gt;) resp_headers.keySet()) {
    String headerValue = ((java.util.List&amp;lt;String&amp;gt;)resp_headers.get(headerName)).get(0).toString();
    System.out.println("\t" + headerName + ": " +  headerValue);&lt;/PRE&gt;
&lt;P&gt;Above code help us in fetching the list of response headers in&amp;nbsp;tRestClient, Is there is any way to fetch the request headers of&amp;nbsp;tRestClient component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specially I am looking for custom headers that we sent in Advance Setting section of&amp;nbsp;tRestClient. I am looking for code where I could fetch all request headers of&amp;nbsp;tRestClient at once like above code give all response headers list and log them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In attached picture i want to fetch all request headers intJavaRow_1 that I set in HTTP headers section of&amp;nbsp;tRestClient&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LxGr"&gt;Screenshot from 2019-11-28 12-16-37.png&lt;/A&gt;</description>
    <pubDate>Thu, 28 Nov 2019 06:48:27 GMT</pubDate>
    <dc:creator>pulkit</dc:creator>
    <dc:date>2019-11-28T06:48:27Z</dc:date>
    <item>
      <title>Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222835#M16275</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is there any way I can print Http Headers with trest client? I am trying to do like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;System.out.println(globalMap.get(&lt;SPAN class="s1"&gt;"tRESTClient_1_HEADERS"&lt;/SPAN&gt;));&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;But it is showing me null......&lt;/P&gt; 
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-11-04 at 7.46.55 pm.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0bu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147199iB08368293BAAAFED/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0bu.png" alt="0683p000009M0bu.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is there something I am doing wrong?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222835#M16275</guid>
      <dc:creator>Parikhharshal</dc:creator>
      <dc:date>2024-11-16T07:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222836#M16276</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;After calling a Restful service using&amp;nbsp;tRESTClient,&amp;nbsp; you can get the headers from the response by using tJavaRow component&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Add a tJavaRow after tRESTClient, with the following code: &lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;//access to global headers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;java.util.Map resp_headers = (java.util.Map&amp;lt;String,java.util.List&amp;lt;String&amp;gt;&amp;gt;)globalMap.get("tRESTClient_1_HEADERS");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;//iterate through the list of headers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;System.out.println("\nResponse Headers list:");&lt;BR /&gt;for(String headerName: (java.util.Set&amp;lt;String&amp;gt;) resp_headers.keySet()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;String headerValue = ((java.util.List&amp;lt;String&amp;gt;)resp_headers.get(headerName)).get(0).toString();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;System.out.println("\t" + headerName + ": " +&amp;nbsp; headerValue);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 07:49:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222836#M16276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-21T07:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222837#M16277</link>
      <description>&lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;: Sabrina, thanks for your answer. I figured this out. 
&lt;BR /&gt; 
&lt;BR /&gt;In a similar way how do I read result from rest client using javarow or javaflex component? 
&lt;BR /&gt; 
&lt;BR /&gt;Any help would be appreciated. Thanks.</description>
      <pubDate>Wed, 21 Nov 2018 07:53:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222837#M16277</guid>
      <dc:creator>Parikhharshal</dc:creator>
      <dc:date>2018-11-21T07:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222838#M16278</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Are you referring to the JSON response of a tRESTClient POST request? It is the body column or the string column that contains the string json? If body column, it is a Document type, link tRestClient to a tXMLMap to extract the string Json, and then link the output to a tExtractJSONFields to extract the value from the string Json, the job looks like:&lt;BR /&gt;tRestClient--main--tXMLMap--main--tExtractJSONFields--tLogRow&lt;BR /&gt;If the string column contains the string json, link tRestClient to tExtractJSONFields and extract the value, the job looks like:&lt;BR /&gt;tRestClient--main--tExtractJSONFields--tLogRow&lt;/P&gt;
&lt;P&gt;Feel free to let us know if it is what you are looking for.&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 08:03:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222838#M16278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-21T08:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222839#M16279</link>
      <description>&lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;: Thsnks for your reply. I know this. 
&lt;BR /&gt; 
&lt;BR /&gt;I have specific need where I need to get entire response from test client as string or object type and then start manipulating it in java. 
&lt;BR /&gt; 
&lt;BR /&gt;If you could tell me how to get that using javarow or java flex, that would be fanatic.</description>
      <pubDate>Wed, 21 Nov 2018 09:04:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222839#M16279</guid>
      <dc:creator>Parikhharshal</dc:creator>
      <dc:date>2018-11-21T09:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222840#M16280</link>
      <description>This was helpful for me.</description>
      <pubDate>Fri, 27 Sep 2019 13:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222840#M16280</guid>
      <dc:creator>kuwaryogi27</dc:creator>
      <dc:date>2019-09-27T13:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Http headers print with trest client</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222841#M16281</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN class="UserName lia-user-name lia-user-rank-Moderator lia-component-message-view-widget-author-username"&gt;&lt;SPAN&gt;&amp;nbsp;for the code.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;//access to global headers
java.util.Map resp_headers = (java.util.Map&amp;lt;String,java.util.List&amp;lt;String&amp;gt;&amp;gt;)globalMap.get("tRESTClient_1_HEADERS");

//iterate through the list of headers
System.out.println("\nResponse Headers list:");
for(String headerName: (java.util.Set&amp;lt;String&amp;gt;) resp_headers.keySet()) {
    String headerValue = ((java.util.List&amp;lt;String&amp;gt;)resp_headers.get(headerName)).get(0).toString();
    System.out.println("\t" + headerName + ": " +  headerValue);&lt;/PRE&gt;
&lt;P&gt;Above code help us in fetching the list of response headers in&amp;nbsp;tRestClient, Is there is any way to fetch the request headers of&amp;nbsp;tRestClient component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specially I am looking for custom headers that we sent in Advance Setting section of&amp;nbsp;tRestClient. I am looking for code where I could fetch all request headers of&amp;nbsp;tRestClient at once like above code give all response headers list and log them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In attached picture i want to fetch all request headers intJavaRow_1 that I set in HTTP headers section of&amp;nbsp;tRestClient&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LxGr"&gt;Screenshot from 2019-11-28 12-16-37.png&lt;/A&gt;</description>
      <pubDate>Thu, 28 Nov 2019 06:48:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Http-headers-print-with-trest-client/m-p/2222841#M16281</guid>
      <dc:creator>pulkit</dc:creator>
      <dc:date>2019-11-28T06:48:27Z</dc:date>
    </item>
  </channel>
</rss>

