form-data with native publish rest endpoint - Mendix 7.10

4
Hi there, I have a published rest POST endpoint in Mendix. The endpoint works fine when posting an object with Content-Type: application/json to it. Unfortunately, the frontend we're working with autmatically sends the request as Content-Type: multipart/form-data​. In the past, the Rest Services module automatically transformed these request into json but this is not working with the new native rest publish functionality.  So my question is: how can I transform the following request: POST /rest/v1/users HTTP/1.1 Host: localhost:8080 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW Cache-Control: no-cache Postman-Token: 5a6b5a9d-7fe4-d5a7-ca12-f33f75da211b ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="addition" 3 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="city" Amsterdam ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="confirmEmail" john@doe.nl ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="confirmPassword" test1234 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="dateOfBirth" 1987-06-29 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="email" john@doe.nl ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="firstName" john ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="lastName" doe ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="houseNumber" 15 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="newPassword" test1234 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="phoneNumber" 0612345678 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="street" Dam ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="zipcode" 1000AA ------WebKitFormBoundary7MA4YWxkTrZu0gW-- ...Into a request the native rest publish feature can work with? Thanks for your help! Kind regards, Tim     
asked
3 answers
2

Hi Tim, unfortunately this is a bug I filed when the REST publish was introduced on this one. It's planned for the upcoming release (7.12) but no guarantees of course ;)

answered
2

I double-checked, seems 7.12 will only fix support for 'application/x-www-form-urlencoded', not 'multipart/form-data'. I suggest you file a support ticket for this.

And 7.12 will be released March 6th.

answered
2

Do we know if this was ever fixed? I seem to be experiencing the same issue. Works great in node, not so much in the Mendix. I'm using 7.21

answered