Can I send Both File and JSON Data in Form-data Using mendix REST Call(POST)?

0
if it is possible,please explain how i should structure the request to send both a file and json data
asked
2 answers
2

Hi Lee,

Yes, you can create one string variable to store your JSON and also retrieve your file from where it is stored (a FileDocument entity). In the Call REST activity, choose Form Data in the request tab, and click Add to specify a key and value. Map the created string JSON variable to the value field, and give a name for the key, like "data" or any other name you prefer. Then, add another key-value pair, with the file entity as the value for the file part.

image.png

 

Hope it helps,

Arun

answered
0

Lee,

See this section in the documentation for instructions on how to send both file and JSON Data:  https://docs.mendix.com/refguide/call-rest-action/#form-data

 

Hope that helps,

Mike

answered