Send Post request to an external API using AWS Lambda in python
Vendored requests
are now removed from botocore
.
Consider packaging your Lambda code with requirements.txt
using CloudFormation package or SAM CLI packaging functionality.
My older answer from before vendored
requests
deprecation: You may be able to leveragerequests
module from theboto
library without having to install or package your function.Consider this import:
import botocore.vendored.requests as requests
You need to install requests
module to your project directory and create a lambda deployment package. See this link for details.
In short, you need to create your index.py file on you development system (PC or mac), install Python & pip on that system; them follow the steps in the doc. To create lambda, choose the 'Upload zip' option instead of the 'Edit inline' one