<?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: tRest GET Error parsing media type in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204204#M5176</link>
    <description>&lt;P&gt;Can you share your tRestClient configuration and some info on the API? A screenshot of the basic and advanced settings should be enough.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 13:22:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-26T13:22:56Z</dc:date>
    <item>
      <title>tRest GET Error parsing media type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204203#M5175</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am facing a challenge using tRest to send GET requests to an API. The same task is currently executed through a powershell script&amp;nbsp;and works fine, however there's room for improvement and I am now looking to get this done through a TOS job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am sending a first request with tRest and get a list of clients using tExtractJSONFields = works fine.&lt;/P&gt; 
&lt;P&gt;Now, I am looking to send another request to a different endpoint, which works perfectly fine on my web browser. However when executing my job tRest --&amp;gt; (main) --&amp;gt; tLogRow, I am getting the below java execution error:&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;Exception in component tREST_3 (APITest)&lt;BR /&gt;java.lang.IllegalArgumentException: Error parsing media type '200'&lt;BR /&gt;at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:80)&lt;BR /&gt;at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53)&lt;BR /&gt;at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119)&lt;BR /&gt;at com.sun.jersey.api.client.ClientResponse.getType(ClientResponse.java:613)&lt;BR /&gt;at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:530)&lt;BR /&gt;at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:505)&lt;BR /&gt;at com.sun.jersey.api.client.WebResource.handle(WebResource.java:563)&lt;BR /&gt;at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)&lt;BR /&gt;at local_project.apitest_0_1.APITest.tREST_3Process(APITest.java:700)&lt;BR /&gt;at local_project.apitest_0_1.APITest.runJobInTOS(APITest.java:1881)&lt;BR /&gt;at local_project.apitest_0_1.APITest.main(APITest.java:1732)&lt;BR /&gt;Caused by: java.text.ParseException: End of header&lt;BR /&gt;at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.getNextCharacter(HttpHeaderReaderImpl.java:219)&lt;BR /&gt;at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.next(HttpHeaderReaderImpl.java:184)&lt;BR /&gt;at com.sun.jersey.core.header.reader.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:112)&lt;BR /&gt;at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:91)&lt;BR /&gt;at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:78)&lt;BR /&gt;... 10 more&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is it due to the response itself? (special character? encoding?)&lt;/P&gt; 
&lt;P&gt;Would you have any insight (using TOS for Data Integration 7.0.1)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 11:58:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204203#M5175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-26T11:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: tRest GET Error parsing media type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204204#M5176</link>
      <description>&lt;P&gt;Can you share your tRestClient configuration and some info on the API? A screenshot of the basic and advanced settings should be enough.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 13:22:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204204#M5176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-26T13:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: tRest GET Error parsing media type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204205#M5177</link>
      <description>&lt;P&gt;It's actually the tRest component that I am using and the configuration is pretty basic as only the URL has been filled in. You will find 2 screenshots of the configuration below.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The API can return either a JSON response or a CSV by adding the parameter &lt;EM&gt;&amp;amp;format=csv&lt;/EM&gt;, but in either case I get the same error.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am not clear about the difference between the tRest and the tRestClient components and in which situation using one rather than the other one, but as my first request returns a valid response, I assumed the second one should work the same way.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If using the tRestClient component with the same basic settings for the 1st request (which works fine), I get the below response :&lt;/P&gt; 
&lt;P&gt;"&lt;EM&gt;200|&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;root&amp;gt;&amp;lt;etc.....&amp;gt;&lt;/EM&gt;"&lt;/P&gt; 
&lt;P&gt;If running the same with the second API request, I get the below error:&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;Exception in component tRESTClient_2 (APITest)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;javax.ws.rs.ProcessingException: java.lang.IllegalArgumentException: Media type separator is missing&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:1157)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1126)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1051)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:897)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:866)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:431)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:611)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at local_project.apitest_0_1.APITest.tRESTClient_2Process(APITest.java:911)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at local_project.apitest_0_1.APITest.runJobInTOS(APITest.java:3768)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at local_project.apitest_0_1.APITest.main(APITest.java:3612)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Caused by: java.lang.IllegalArgumentException: Media type separator is missing&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.handleMediaTypeWithoutSubtype(MediaTypeHeaderProvider.java:191)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.internalValueOf(MediaTypeHeaderProvider.java:80)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.valueOf(MediaTypeHeaderProvider.java:66)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.utils.JAXRSUtils.toMediaType(JAXRSUtils.java:1711)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.impl.ResponseImpl.getMediaType(ResponseImpl.java:248)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:331)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.AbstractClient.readBody(AbstractClient.java:539)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;at org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:1138)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;... 9 more&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tRestClient1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0ME.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148632iB0EBFC07BBC07947/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0ME.png" alt="0683p000009M0ME.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tRestClient2.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0Ae.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157007iD25B34E070A0CB5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0Ae.png" alt="0683p000009M0Ae.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I am just starting with Java and despite some time googling this, I did not find a solution.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:48:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204205#M5177</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-26T14:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: tRest GET Error parsing media type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204206#M5178</link>
      <description>&lt;P&gt;I am still facing the same issue, however the same basic request returns perfectly valid results in Postman. Any idea what could cause this java error? What other information could help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 09:02:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204206#M5178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-13T09:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: tRest GET Error parsing media type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204207#M5179</link>
      <description>&lt;P&gt;I think your content type is incorrect. Try using ....&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="str"&gt;"application/json"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You should at least see a different error message&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:32:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204207#M5179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-13T12:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: tRest GET Error parsing media type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204208#M5180</link>
      <description>&lt;P&gt;Thanks for your feedback rhall_2_0, unfortunately I've tried that and I am getting the exact same error message...&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 08:26:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRest-GET-Error-parsing-media-type/m-p/2204208#M5180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-15T08:26:45Z</dc:date>
    </item>
  </channel>
</rss>

