This is the text that Mendix creates when I use the form-data option.
------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="file";
Content-Type: application/pdf
[THE BINARY CONTENT]
------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="somefield"
bladiebla
------WebKitFormBoundaryfxchezaSjlWtxBDp--
This fails when I use this in Postman. But, when I add filename="Example.pdf", then it works fine in Postman.
------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="file"; filename="Example.pdf"
Content-Type: application/pdf
[THE BINARY CONTENT]
------WebKitFormBoundaryfxchezaSjlWtxBDp
Content-Disposition: form-data; name="somefield"
bladiebla
------WebKitFormBoundaryfxchezaSjlWtxBDp--
When I use this in Mendix as the raw body in Mendix (with the correct Content-Type), it will not work and will result in the error as in the original post.
So... am I doing something completely wrong or does Mendix(/Java) messes things up?