Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 81235

REST Services module: problem with parameter name for binary data in POST request

$
0
0

I would like to call an OCR API that expects a HTTP POST with the image to be processed in the request body .

When sending the request with the REST client https://resttesttest.com, everything works fine. With this tool, the request body looks as follows:

-----------------------------2237299324779
Content-Disposition: form-data; name="file"; filename="20160617_143958.jpg"
Content-Type: image/jpeg

In Mendix, I am trying to send my request with the REST Services module, which can send binary data in the request body as described here.

However, the OCR API does not respond to the request generated by Mendix properly. I suspect that the problem is with the parameter name: while the API expects the binary data to be in a parameter named "file", the REST Services module probably puts the binary data of the image in an parameter named "Content" (i.e. the name of the attribute with the binary data in the Mendix object type System.Image).

How can I solve this problem? Is there any way to adjust the parameter name the Rest Services module is using for binary data?


Viewing all articles
Browse latest Browse all 81235

Trending Articles