Native REST in Mx7 does not (yet) support multipart FormData
1. Download the REST service module from the appstore
2. Add JavaAction call 'post' to MF configure this: (set submit as formdata to true)
3. Associate the filedocument to the root - this is your NPE object, configured as Request data (root points to object containing the file). Any other data you wish to sent can be added by creating entities related to the root.
4. rename the assocation to match the field name for the file (e.g. "File")
5. Add the required headers (via JavaAction call addHeaderToNextRequest), place these before the JA call post. For example, an access-token, a bearer-token, application/json etc.
Edit: added more screenshots and information about the additional headers
If i understand you correctly you want to publish a rest API in Mendix which can be used for multipart file upload?
1 - Publish a Put REST service like described here: https://docs.mendix.com/refguide/published-rest-operation
2 - Note that the Request object should have the image as base 64 encoded value (string), so you can decode it in the microflow of the Put service to an image (make a file object before and decode it using Java ActionBase64DecodeToFile from commons module)
Another possibility is you can receive it directly as binare file with the other data
Hi
I did like above in my microflow what i hav to do afetr that i want to send multipart form data to my API i used
rest service module from appstore and called the post java action call from rest service in my microflow
i am not aware of rest service module so anyone help me with the step by step solutiin @Stephan Bruijnis helped me above but can able to get in to this.
thanks in advance
hi
i have changed the association name as a form field i am getting this error. @Stephan Bruijnis please look at this
Hi here is the response am getting from the java action post @Stephan Bruijnis
Hi @Stephan Bruijnis. here is the error i am getting with the Dropzone widget