I am trying to make rest api call from my cics-cobol program. The Web-Open was successful. During the web converse i am getting return code = 400 with response - {"detail":"There was an error parsing the body"}.
When do we usually get such errors? The API call to the same URL with same JSON request body works fine from POSTMAN. But through web converse i am not able to get the same response. Any suggestions on how to fix this?
In order to compare the body received by both means (by cics & by postman), is there a way to put print statements in the api call to see the body it has received?
When you say "return code" I am going to presume you mean "http status code" because 400 is neither a valid value for EIBRESP nor EIBRESP2 in this context.
An http status code of 400 means...
...so presuming (because you don't say explicitly and you haven't provided your code) you are using a POST to send content, then the content isn't what the API expects.
Whatever means you are using (because you don't say what that is) to make this "API call to the same URL with the same JSON request body" is doing something different than what you're doing in your code (which you don't provide).
Checking EIBRESP and EIBRESP2 might help. Comparing what is being sent, including http headers, between your code and the code that works might help.