furaiev / amazon-cognito-identity-dart-2

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
187 stars 114 forks source link

GET can work, but POST failed with "POST: 403, {"message":"The request signature we calculated does not match the signature you provided..." #51

Closed cabbagebai closed 4 years ago

cabbagebai commented 4 years ago

When I am using GET the request succeeds. But when I use POST with a body I get this error response, POST without a body can work The request signature we calculated does not match the signature you provided. ... I saw someone mentioned exactly the same issue in amazon-cognito-idenity-dart: https://github.com/jonsaw/amazon-cognito-identity-dart/issues/35 But I tried following code without any luck, any help is appreciated! final headers = Map<String, String>(); headers["Content-Type"] = "application/json; charset=utf-8"; final signedRequest = SigV4Request(client, method: 'POST', path: path, body: jsonBody, headers: headers); final response = await http.post(signedRequest.url, headers: signedRequest.headers, body: jsonBody);

cabbagebai commented 4 years ago

Never mind, it's my fault. I should use signedRequest.body in http.post

darmawan01 commented 3 years ago

same issues here, how the post code you have ? maybe you can share. got the same error i was add the headers but still got that error