[英]Using Post Method in angular app hosted in S3 in AWS
I have uploaded my angular 6 app to S3 in AWS. 我已将我的angular 6应用程序上传到AWS中的S3。
I wish to use a post method to take user input and move it using API Gateway. 我希望使用post方法接收用户输入并使用API Gateway移动它。
Later i would want to move the user entered data to DynamoDB. 稍后,我想将用户输入的数据移至DynamoDB。
So my question boils down to this. 所以我的问题可以归结为这一点。
How do i move my user submitted data from angular app to dynamodb using post method ? 如何使用post方法将用户提交的数据从angular应用程序移动到dynamodb?
I am new to AWS so any help you can give me will be most appreciated. 我是AWS的新手,因此,您能给我的任何帮助将不胜感激。
Thanks in advance. 提前致谢。
You need to setup an endpoint in API Gateway that accepts a POST request. 您需要在API网关中设置一个接受POST请求的终结点。 Then from the Angular side this would be a simple HTTP POST request just like any other, there would be nothing AWS specific about it in your Angular code unless you want to enable some sort of authentication on the endpoint. 然后从Angular角度来看,这将是一个简单的HTTP POST请求,就像其他任何请求一样,除非您想在端点上启用某种身份验证,否则在Angular代码中将没有关于它的AWS特定要求。
On the backend the API Gateway endpoint can either act as a DynamoDB proxy to insert the data directly into DynamoDB, or it can call an AWS Lambda function which would then insert the data into DynamoDB using the AWS SDK. 在后端,API Gateway端点可以充当DynamoDB代理以将数据直接插入DynamoDB中,也可以调用AWS Lambda函数,然后使用AWS开发工具包将数据插入DynamoDB中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.