Hello @praveen ,
Can you kindly tell me the error that you are getting when you execute your code?
Be sure that the HMAC signature and the date being provided is correct. If both of them are correct, then it must be content and content-length which is causing the error.
As you said you are able to execute it correctly in Postman, I suggest you check the code that is generated in Postman and compare it to yours to know where you are going wrong with your code.
How can you generate a code in Postman? After successfully sending the request in Postman, click on "Code" (which is below the "Send" button). This will open a dialog box. You can select Java from the dropdown and the HTTP library you are using to generate the code.