You could try to use a regular POST action, add the custom header as Dennis mentioned, and then use a custom request template to build up the request. In the template / request body you specify each of the parameters as:
Did you try the Custom HTTP headers in your REST consume action? Add an option with Key = Content-Type, value = x-www-form-urlencoded. See also https://docs.mendix.com/refguide/call-rest-action#3-2-custom-http-headers
For anyone seeing this post I would like to add that instead of using Content-Type = x-www-form-urlencoded you should use (or could try) Content-Type = application/x-www-form-urlencoded in your custom header. That fixed it for me.
I was successful when sending a x-www-form-urlencoded request as json file with the following configuration (Mendix V8.14.1):
Get the token:
(It is not clear why the Authorization needs the parameter ‘eDp4’. The parameter was created with POSTMAN and UserName=’x’ and Password=’x’. Maybe it has something do do with my server, but without these parameter it does not work)
Get the data with the token:
$TokenObject/access_token is the token read before.