title: Lambda Check if method is POST
body: <p>I am defining a USER view. It does something like this->
  If method is GET -> Lambda interacts with RDS on the backend and return all the USER views.</p>
  
  <pre><code>GET /list-views/users/user_id/list_object_types/list_object_type_id
  </code></pre>
  
  <p>If method is Create -> A new user will be created and added into RDS.</p>
  
  <pre><code>POST /list-views/create
  </code></pre>
  
  <p>If method is delete -> A user will be deleted. </p>
  
  <pre><code>PATCH /list-views/id
  </code></pre>
  
  <p>I am able to do this by creating function in lambda like this-></p>
  
  <pre><code>def fetch_thing(method):
      if method == "POST":
          API_ENDPOINT = ""
          dataa={"type" : "abc", "price" : 123.11}
  
          xz = requests.post(url=API_ENDPOINT, json = dataa)
          re=xz.json()
  
  
      elif method == "GET":
          r11 = requests.get(url="")
          re = r11.json()
  
      return re
  </code></pre>
  
  <p>But when I try to integrate this with Lambda, It gives the error as "Integration has to be defined"
  I believe it is because my main lambda_handler-> *Note this is what I have been trying to make it run as until this is mentioned over here, it won't let me integrate lambda with API.</p>
  
  <pre><code>def lambda_handler(event, context):
  
  if event['queryStringParameters']['paramName'] == "POST":
      return "hi"
  </code></pre>
  
  <p>Any suggestion will be really helpful, The goal is to whenever a new user creates a view, lambda updates the RDS table, I am doing this by checking the method request and then submitting this via API endpoints to the Front End developers</p>