title: Sending and reading data to AWS Lambda function
body: <p>So i have setup a lambda function to upload a txt file to S3. How do i send data to the function using API Gateway?</p>
  
  <p>Ive setup API Gateway to have a POST method.</p>
  
  <p>here is my Lambda function</p>
  
  <pre><code>import boto3
  
  s3 = boto3.resource('s3')
  
  def lambda_handler(event, context):
  
      data = 'Totally awesome sword design' #event['data']
  
      filename = 'awesomeSword2' #event['filename']
  
      object = s3.Object(BUCKET_NAME, KEY + filename + '.txt')
      object.put(Body=data)
  </code></pre>
  
  <p>I just need to know how to send data and filename to the function (and read it)</p>