简体   繁体   中英

Can't send request via Amazon CloudFront: 403 Error

I created an AWS Lambda function with crud (create, view, update, delete) operations on laravel framework.

I want to update record:

User::where('email', 'balbla@gmail.com')->update(['name' => $request->get('name')]);

But I have this error:

403 ERROR
The request could not be satisfied.
Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. 
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. 
Generated by cloudfront (CloudFront)

When I execute http get method, all work perfectly. I have read documentation about CloudFront, but haven't no idea how to fix it. I used postman. If I understand the problem is with $request , and I need to create distribution in Amazon CloudFront.

That was my mistake. I opened postman and created new query with GET method with added json to a raw:

{
    "name" : "bla bla some name"
}

When I removed this json all worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM