title: How to write a simple http request(method) based AWS lambda function in Python?
body: <p>I am new to AWS. and I want to integrate API Gateway with my lambda function. The thing which I want to achieve is that: for every HTTP request made i need to just print a statement that the specific request is hit!. For e.g. suppose a GET request hits my api endpoint, I need to display just "GET request made" in the browser. And if say a post request is made.. I want to display the message "POST request made" and if possible additionally the posted data. I searched a lot but couldn't find anything. However I found a code snippet but it's written in node.js. Below I am attaching the snippet.</p>
  
  <pre><code>exports.handler = async (event) =&gt; {
      console.log(event);
      if (event.httpMethod === 'PUT') {
          let response = putShows(event)
          return done(response);
      } else if (event.httpMethod === 'GET') {
          let response = getShows(event);
          return done(response);
      }
  };`
  </code></pre>
  
  <p>The whole code is available <a href="https://github.com/SamWSoftware/Projects/tree/master/movieAPI" rel="nofollow noreferrer">here (on GitHub)</a></p>