Python at AWS Lambda: `requests` from botocore.vendored deprecated, but `requests` not available

后端 未结 7 2171
梦如初夏
梦如初夏 2021-02-07 16:07

I\'ve got a Python script for an AWS Lambda function that does HTTP POST requests to another endpoint. Since Python\'s urllib2.request, https://docs.python.org/2/li

7条回答
  •  无人及你
    2021-02-07 16:36

    If you are using serverless framework

    Specify the plugin in serverless.yml

    plugins:
    - serverless-python-requirements
    

    At the directory root create file requirements.txt

    requirements.txt

    requests==2.22.0
    

    This will install the requests and packages mentioned.

提交回复
热议问题