Native REST - Accepting JSON payload?

0
I need to create a rest endpoint where i accept a JSON payload from the consumer.  I see how to get primitive attributes into the native rest service but i don't see how I can get an object into it.  Anyone know how to make this work?  I can't set an object as another parameter for the microflow service.  How can I make this work?  When I use Postman to send a request, the body of the request (JSON) shows up in the Content attribute of the httpRequest inbound object to the microflow.  However, when the outside application makes a request to that service, the Content attribute is blank ('').  When I set the Rest Publish log node to TRACE, i can see that the size of the incoming request is  Content-Length: 2317 Yet the content attribute is blank.
asked
2 answers
2

First: What version of Mendix are you using?  Next: the problem is in the application that makes the request. Or more specifically, your services receives calls fine when called by Postman, so the question is: what is different between the Postman-call and the outsides applications calls?

 

answered
1

Ok, so I was able to reproduce the problem from Postman.  When I carefully inspected the headers coming from the service, i see they are sending a header for Content-Type: x-www-form-urlencoded, yet they are sending JSON in the body.  When i forced a header like that from Postman with a JSON body, the content parameter in Mendix is empty.  Not sure this is best practice from Slack's end but it is causing an issue here.

UPDATE:

Figured it out.  Slack is responding with a www-form-urlencoded single parameter of "payload" with the JSON in the payload parameter.

answered