当我在Postman中测试时,可以使用AWS Lambda函数,但是当我尝试在ReactJS中实现时,我得到状态码500

I working with ReactJS trying to create a contact form using AWS Lambda and SES. I was following this guide for the AWS setup. When I send my json file using postman I have no issues status 200 and the email sends, great! then I try to implement it in my React file and I have issues. despite having the same API endpoint.

function post(url, body, callback) {
      var req = new XMLHttpRequest();
      req.open("POST", url, true);
      req.setRequestHeader("Content-Type", "application/json");
      req.addEventListener("load", function () {
        if (req.status < 400) {
          callback(null, JSON.parse(req.responseText));
        } else {
          callback(new Error("Request failed: " + req.statusText));
        }
      });
      req.send(JSON.stringify(body));
    }
const handleSubmit = (e) => {
      e.preventDefault();
      console.log(this.state.form);
      post(url, this.state.form, function (err, res) {
        if (err) {
          return alert(err);
        }
        alert("success");
      });
    };

我从AWS收到的响应:

{
message: "Missing Authentication Token"
}

I've tried these steps AWS lessons on missing token

Postman

I have checked the url 1000 times and unless I'm missing something it is correct. Invoke URL: https://EXAMPLE.execute-api.us-east-1.amazonaws.com/prod/email/send

also tried everything from here

不知道我错了什么以及邮递员为什么工作,但是我的代码没有任何帮助,将不胜感激。