Call Rest Service for upload file

0
There is an external API, the parameter is a file, in Mendix using Call Rest to call this API has not been successful, from the console to see the following error An error has occurred while handling the request. [User 'ShenS61' with session id 'd7cbc4d2-XXXX-XXXX-XXXX-XXXXXXXX15ff' and roles 'OMTUser'] -------- com.mendix.modules.microflowengine.MicroflowException: Error calling REST service    at OCRRecognition.ACT_OCR_Upload (CallRest : 'Call REST (POST)') Advanced stacktrace:    at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79) Caused by: com.mendix.modules.microflowengine.MicroflowException: 400: BAD REQUEST    at OCRRecognition.ACT_OCR_Upload (CallRest : 'Call REST (POST)') Advanced stacktrace:    at com.mendix.integration.actions.microflow.RestCallAction.checkStatusCode(RestCallAction.scala:117)   Call Rest and External as below:
asked
1 answers
0

The REST service that you are calling throws a 400 response. 

 

Documentation:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

 

"The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)."

 

You will have to figure out why the REST Service will not accept the call that you are making. The logging provides little information so you'll have to check the documentation of the external API for instance. 

answered