title: POST to AWS Gateway API from Python into Dynamodb
body: <p>I'm posting a simple JSON structure to Amazon Gateway API from Python. </p>
  
  <p>Here's the JSON structure:</p>
  
  <pre><code>payload = {
  'ping': '1.967',
  'download': '570.01',
  'upload': '697.85',
  'timestamp': '1527845073'
  }
  </code></pre>
  
  <p>And here's the python code:</p>
  
  <pre><code>headers = {'content-type':'application/json'}
  r = requests.post("https:xxx.execute-api.us-east-1.amazonaws.com/beta/device", data = payload ,headers=headers)
  print(r.status_code, r.reason)
  print(r.text)
  </code></pre>
  
  <ul>
  <li>r.status_code is returned as <em>'200'</em>  </li>
  <li>r.reason is returned as <em>'Ok'</em></li>
  <li>r.text is returned as <em>{"__type":"com.amazon.coral.validate#ValidationException","message":"One or more parameter values were invalid: An AttributeValue may not contain an empty string"}</em></li>
  </ul>
  
  <p>The parameters are clearly not empty so I'm not sure why I'm getting that error. I have a Body Mapping Template in the Integration Request that looks like this:</p>
  
  <pre><code>{ 
  "TableName": "device",
  "Item": {
  "id": {
          "S": "$context.requestId"
          },
  "ping": {
          "S": "$input.path('$.ping')"
          },
  "download": {
          "S": "$input.path('$.download')"
      },
  "upload": {
          "S": "$input.path('$.upload')"
      },
  "timestamp": {
         "S": "$input.path('$.timestamp')"
  }
  }
  }
  </code></pre>
  
  <p>And when I run the test from within AWS Gateway API Console, the data inputs into the DynamoDB just fine. However, it won't work from Python. Any idea what I could be doing wrong? I'm betting it's a silly mistake. Thank you.</p>