Ask questionsThe request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method

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>',
  url: 'https://<API GATEWAY ID>.execute-api.<AWS REGION><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)

Answer questions mhart

Closing as an issue with axios, not this library


Related questions

Credential must have exactly 5 slash-delimited elements hot 2
Github User Rank List