We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i'm getting AWS signature mismatch when i send request to API Gateway using axios
let data = JSON.stringify({ "action": "message", "data": 'testing' }) let request = { host: '<API GATEWAY ID>.execute-api.<AWS REGION>.amazonaws.com', url: 'https://<API GATEWAY ID>.execute-api.<AWS REGION>.amazonaws.com/dev/@connections/<CONNECTION ID>', path: 'dev/@connections/<CONNECTION ID>', service: 'execute-api', region: '<AWS REGION>', data: data, body: data, headers: { 'Content-Type': 'application/json' } } let signedRequest = aws4.sign(request, { secretAccessKey: '<AWS SECRET KEY>', accessKeyId: '<AWS ACCESS KEY>' }) let response = axios(signedRequest)
The text was updated successfully, but these errors were encountered:
@bala-drg Did you find any resolution to this? I'm having the same issue and it seems to have happened quite suddenly.
Sorry, something went wrong.
I found a fix that worked for me. You have to add body to the request and make it a string of the data object.
example: request.body = JSON.stringify(request.data);
request.body = JSON.stringify(request.data);
Put that before the aws4.sign method and it works. The problem is due to how Axios uses data rather than body.
Closing as an issue with axios, not this library
No branches or pull requests
i'm getting AWS signature mismatch when i send request to API Gateway using axios
The text was updated successfully, but these errors were encountered: