Send Post request to an external API using AWS Lambda in python

前端 未结 2 550
南方客
南方客 2021-01-01 01:07

I want to send a post request to an external API (https://example.com/api/jobs/test) every hour.

The Lambda Function that I used is as follows:

Handl         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 01:41

    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 leverage requests module from the boto library without having to install or package your function.

    Consider this import: import botocore.vendored.requests as requests

提交回复
热议问题