title: How to call an external API webservice from Python in Amazon Lambda?
body: <p>I am pretty new to AWS Lambda i have a python code which has a post method for making an external API call,</p>
  
  <pre><code>import requests
  import json
  url = "http://sample/project"
  headers = {
     'content-type': "application/json" 
      }
  r = request.post(url,headers=headers)
  </code></pre>
  
  <p>I tried putting it into a AWS Lamda call i tried like this below but it didn't get worked out</p>
  
  <pre><code>import requests
      import json
      url = "http://sample/project"
      headers = {
         'content-type': "application/json" 
          }
  
  def lambda_handler(event, context):
      response = requests.request("POST", url, headers=headers)
      return response
  </code></pre>
  
  <p>But i am not getting in any response if i am running from local machine i am getting the output.Please help me how can i make a post call from AWS Lamda</p>