Multipart/form-data rest request

One Star

Multipart/form-data rest request

Hello, I need to upload file to a rest service using POST request with multipart/form-data content type. What component should I use for this?
As I understand, tRest doesn't support multipart/form-data. 
Does anyone have working example?
Moderator

Re: Multipart/form-data rest request

Hi,
Have you already checked tRestClient component to see if it is satisfying your needs(multipart/form-data content type)?
Here are XML, JSON, or FORM according to the media type of the content to be uploaded to the server end.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Multipart/form-data rest request

Did this ever get resolved?
I also have the need to upload a binary file to a RESTful webservice where the REST service has the following signature in Java:
@POST
@Path("/uploadFile")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response uploadFile(
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail) {
However, I am not able to get this to work with the tRestClient component or the tRest component.
Any help would be much appreciated.
currently, I am using "Talend Open Studio for Data Integration 6.1.0.20151029_1337"
I have control over the REST service, so changing the method parameters is possible.  All I need to capture is the binary file and its name.
Moderator

Re: Multipart/form-data rest request

Hi DonBoyd,
We have replied to your another topic:https://www.talendforge.org/forum/viewtopic.php?id=47926.
Could you please check it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.