<?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: tRestClient : send a file with FORM content type and POST in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377780#M139591</link>
    <description>&lt;P&gt;You can get the response by filling in the "Destination directory" and "Destination filename" fields. This will create a file which you can read in a subjob that runs after this process (by subjob, I mean a series of components that are linked to the tFileFetch via a OnSubJobOK link. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately sending files via the tRestClient like this isn't supported. However, one of the significant advantages of Talend Studio is that you can anything like you with Java. So, if you are able to write Java you can write this for yourself with a routine and a tJavaFlex. I'd knock something up now if it weren't for the time. I'm UK based and it is getting a little late. If you are still struggling tomorrow, I'll have a go at putting something together &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 02:54:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-27T02:54:32Z</dc:date>
    <item>
      <title>tRestClient : send a file with FORM content type and POST</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377777#M139588</link>
      <description>&lt;P&gt;Hello everyone, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to send a file using a tRestClient.&lt;/P&gt;&lt;P&gt;I set HTTP Method to POST, Content-Type to FORM, and Accept Type to JSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imagine that I must read the file data using tFileInputRaw, and then pass this String to tRestClient component as "string" field ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone already send files using a REST API ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 16:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377777#M139588</guid>
      <dc:creator>Alpha549</dc:creator>
      <dc:date>2022-01-26T16:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient : send a file with FORM content type and POST</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377778#M139589</link>
      <description>&lt;P&gt;Try using the tFileFetch component. It is better suited to this requirement. The name is somewhat misleading as it will send files as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a quick example config that I have used for a REST service which was configured to receive form data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000N3MXKAA3.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136041i57A7896B0A1C5FD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000N3MXKAA3.png" alt="0695b00000N3MXKAA3.png" /&gt;&lt;/span&gt;Above is the "Basic settings" tab. Here you set the URL of the REST service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000N3MYhAAN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145919iDDD76785C6BEFF33/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000N3MYhAAN.png" alt="0695b00000N3MYhAAN.png" /&gt;&lt;/span&gt;The screen above shows where you set the "upload" settings. First of all tick the "Upload file" tickbox. Then you need to add a row to the "Files" table. Here you will set the "Name" which is the form name of the param which holds the filename. In my HTML file it was called "file". The "File" field is used to hold the location of the file. This can be set using a context variable, globalMap or it can be hardcoded as I have done above. You then need to set the "Content-Type" of the file and the "Charset".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once that is all set, it will send the file to your form fed REST API.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 21:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377778#M139589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-26T21:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient : send a file with FORM content type and POST</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377779#M139590</link>
      <description>&lt;P&gt;Hello rhall, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't know this method.&lt;/P&gt;&lt;P&gt;Here I have to get a code from the response, in order to run another process. With tFileFetch method I'm not sur I can get this code as a response ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I test the URL using Postman, the body type is form-data.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 02:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377779#M139590</guid>
      <dc:creator>Alpha549</dc:creator>
      <dc:date>2022-01-27T02:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient : send a file with FORM content type and POST</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377780#M139591</link>
      <description>&lt;P&gt;You can get the response by filling in the "Destination directory" and "Destination filename" fields. This will create a file which you can read in a subjob that runs after this process (by subjob, I mean a series of components that are linked to the tFileFetch via a OnSubJobOK link. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately sending files via the tRestClient like this isn't supported. However, one of the significant advantages of Talend Studio is that you can anything like you with Java. So, if you are able to write Java you can write this for yourself with a routine and a tJavaFlex. I'd knock something up now if it weren't for the time. I'm UK based and it is getting a little late. If you are still struggling tomorrow, I'll have a go at putting something together &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 02:54:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377780#M139591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-27T02:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient : send a file with FORM content type and POST</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377781#M139592</link>
      <description>&lt;P&gt;Hello @Richard Hall​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I succeed in doing what I wanted !&lt;/P&gt;&lt;P&gt;I created a custom JAR on Eclipse and imported it in Talend !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for you help and enriching my vision !&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 20:05:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377781#M139592</guid>
      <dc:creator>Alpha549</dc:creator>
      <dc:date>2022-01-27T20:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient : send a file with FORM content type and POST</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377782#M139593</link>
      <description>&lt;P&gt;Not a problem. Glad it worked! One last thing I feel I should offer, try not to jump straight to coding a solution in Java first. It is incredibly useful and opens many doors, but don't get caught in the trap of "reinventing the wheel". Always have a look for non-coding solutions first &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 21:38:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-send-a-file-with-FORM-content-type-and-POST/m-p/2377782#M139593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-27T21:38:04Z</dc:date>
    </item>
  </channel>
</rss>

