Hi Matthias,
The backend server is a 3rd party and getting the logs is not an option.
However, I was able to get 200 valid response back by bypassing Datapower.
400 the error message complains about the first parameter they check in the following scenarios:
1. Datapower(build the request)--> 3rd Party backend API
2. ESB AppConnect (build the request) --> Datapower (just passthrough) --> 3rd Party backend API
I suspect some sort of wrapper in the body request that is causing the issue.
200 valid response back when:
1. ESB AppConnect (build the request) --> 3rd Party backend API.
Using Datapower is as our gateway is a requirement, but it seems Datapower is doing something to the request that the backend APi doesn't like.
Any experience with this?
------------------------------
Michael Bae
------------------------------
Original Message:
Sent: Wed August 17, 2022 07:27 AM
From: Matthias Siebler
Subject: Sending POST request with content type 'application/x-www-form-urlencoded'
Hi it is neither necessary nor possible to set the content length for a post request from the datapower ; the code will calculate that automatically.
What do the logs from the backend server say? Does it indicate why this is a bad request? Can you try it against a local loopback datapower service to see if you can get more data?
------------------------------
Matthias Siebler
MA
Original Message:
Sent: Tue August 16, 2022 02:15 PM
From: Michael Bae
Subject: Sending POST request with content type 'application/x-www-form-urlencoded'
In datapower Multi-Protocol_Gateway Policy rule, we are building a POST request with content-type 'application/x-www-form-urlencoded'.
However the backend comes back with 400.
To make it the simplest, we set the content-type to 'application/x-www-form-urlencoded',
then session.output.write('clientId=1234&grantType=password');
Looking at the probe, I see the Content with the request clientId=1234&grantType=password,
and Headers include Content-Type 'application/x-www-form-urlencoded'.
am I missing something here?
------------------------------
Michael Bae
------------------------------