Cosuming REST service - Post method - Error 400 Bad request
Good morning, this is my first post in this forum. Hope to learn a lot from you guys! I am dealing with a REST service. Trying to consume a POST method trough the microflow posted below. I create a JSON structure, the related export mapping and the REST service action. Then there is a show message action containing the response back of the service. When starting the microflow I got the error: An error has occurred while handling the request. [User 'Anonymous_72cdfd95-c9fc-4017-ae71-3f5392dbf142' with session id '8c3d5cc2-XXXX-XXXX-XXXX-XXXXXXXX5dbd' and roles 'Administrator'] Caused by: com.mendix.modules.microflowengine.MicroflowException: 400: Bad Request at MyFirstModule.ProcessID_Post (CallRest : 'Call REST (POST)') I am pretty sure that the syntax that I used is correct, by the way is there something that I am forgetting? Is it possible that the location link is not active? Thank you guys :)
You may add Content-Type custom HTTP header in HTTP Headers tab.
Did you try sending the same request via a tool like Postman? If so, is it working there? If so, what is the difference between the postman setting and the mendix rest call. If not, you might try something that is not supported by the API.
Thank you Naofumi, it works! I was missing the Header!
thank you for the answer. I fixed the case difference but I can’t still access the page. I also tried to use SoapUI ( a software used to test REST services) it couldn’t access the resource.