I have a
java process which is listening to ActiveMQ messages and when the status is COMPLETE, I am calling HTTP POST as shown in the code below. I'm referring to the following
article (
https://mkyong.com/java/how-to-send-http-request-getpost-in-java/) for sending POST. However, I'm running into following issue:
In the eclipse console, I am getting the following error:
When I used POSTMAN, the request worked fine but I had to make following changes in the POSTMAN (as shown in the screenshot below - encircled in red).
1) Put my parameters inside Body section of POSTMAN
2) Changed the type to JSON.
[![enter image description here][2]][2]
My relevant code below:
What am I doing wrong inside the `sendPost()` method while calling HTTP POST? Do I need to take care of JSON thing just like I did in POSTMAN. If yes, then how? Please advise. Thanks !