How to use the Mendix v2 API Package Upload from a Mendix-app
0
Hi Folks, I am trying to use the Mendix Package Upload v2 API, which works well from cURL and Postman. However I can't get it to work from a Mendix app using a REST (POST) request. The request ends up at the Mendix server, but always fails - without any further information in the details of the ... menu. I suspect the issue is in the file-specification of the package. The doc says you need to do this as multipart/form-data. In Postman you add a file-type item named 'file', and then by point&click you select the package file. Also cURL makes very clear how to address a file with the file=@{filepath} syntax. The Mendix doc is not so clear: is could be a multipart/form-data item with syntax: file={filepath}, or possibly file={@filepath}, as suggested in the Example Request. I also tried specifying the file as a sub-header of the multipart/form-data item Content-Disposition=form-data (as specified in rfc2183, and done by Postman, and also shown in the before-mentioned Example Request). Bottom line: no luck so far. Did anyone succeed in using this specific API-request from a Mendix app? How do I specify the file? Any help appreciated!
asked
Pieter van Dijk
1 answers
0
I picked up this project again and found the solution: you do not specify the file by a path/Name but specify it simply as a Mendix file resource. So you first upload the file to your own (client) app, and then use that resource in the Form-data POST request, as 'file', see screen shot.