Closed SrbModi closed 3 years ago
@SrbModi can you please post the full code including how you're making the request?
Also, if you're in the browser, you might want to try https://github.com/mhart/aws4fetch
Resolved the issue.
Had to use aws4-browser
.
Also, as I realised through the debugging mentioned in question, the body parameter needed to be updated. Almost everywhere it said to use JSON.stringify()
before passing the request.body, but it turns out not using it was the key.
body: JSON.stringify(request.body) || ''body: request.body || ''
(empty string takes care for GET requests)
BTW, thanks @mhart for the quick response. It's good to know that you provide continous support for your library.
Closing the issue.
Hi.
Response returned by AWS:
I checked the same credentials in postman and there it is working fine. So, I think there is no issue with the credentials.
Also, I tried to compare the expected canonical string provided in the response. I can see that the
body hash
andcontent-length
is different, this might be the issue.Can someone please point out the issue here. Thanks.
Note: I am doing this in browser for Swagger UI. I also tried using the
aws4-browser
. Getting the same result.