Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

tRestRequest incoming attachment handling

Highlighted
One Star

tRestRequest incoming attachment handling

Hi,
what is the best practice to handle incoming attachment of a REST service?
We would like to have a REST service capable of accepting attachment/file, storing this file and processing it, resulting in a kind of response.
How can this be handled?
One of the possibilities is to have an incoming file encoded in base64 and added into a REST Request as a Header, then parsing the Headers for parameter, retrieving the value of this parameter, decoding the file and storing/using it.

Is there a way of accessing attachments of a REST service? If yes, can you provide a java code/example for it?

Thank you in advance
Highlighted
Seventeen Stars

Re: tRestRequest incoming attachment handling

An attachment for a REST service? Never heard about that! The only way is to send the attachment and all other parameters as form parameter and configure the tRESRequest to accept formula data. The parameter containing the attachment should be configured as byte[].
One standard conform way to send binary data is to convert the data into a Base64 string and send this string as json value.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read