Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mdesmons1651504227
Contributor
Contributor

Host to POST form-data with tRestClient

I need to use tRestClient for a POST request using "multipart-form", but I fail to understand how to send multiple elements through "form" format.

I have this postman configuration working very well :

0695b00000QFccqAAD.png

My body should contain :

  • a "Document" field, wich is in XML datatype. I can't write this field in a file, because I may have multiple jobs running at the same time, concurrencing this file. 0695b00000QFcdtAAD.png
  • a "File[]" wich is an array of files I am sending to the server. In my case, there is only one file sent.

How should I configure my body in order to sent both "Document" and "File[]" fields ? I managed to send only the "Document" one, but I don't know how to add the other in my t_XMLMap

Here are some screenshots of my job :

0695b00000QFcgEAAT.png

0695b00000QFcfVAAT.png

0695b00000QFcgOAAT.png0695b00000QFcfkAAD.png

Labels (5)
1 Reply
Anonymous
Not applicable

The first thing to try is to convert the XML to a String, create a file using Java, then convert the file to a byte array. Once this is done set the API parameter in your tRestClient using the Query Parameters box. Pass the byte array you have created as an Object.