title: Request body serialization differences when lambda function invoked via API Gateway v Lambda Console
body: <p>I have a simple API set up in AWS API Gateway.  It is set to invoke a Python 2.7 lambda function via API Gateway Proxy integration.</p>
  
  <p>I hit a strange error in that the lambda worked (processed the body correctly and updated a DB) when invoked locally and through the lambda test console, but not through curl or Postman.</p>
  
  <p>Turns out that, when invoked through the lambda test console, the <code>event['body']</code> object is coming through as a <code>dict</code>.  When called via an HTTP client, it's coming through as a string (<code>Unicode</code>).</p>
  
  <p>I can work around it of course, but I'd like to understand it, and I'd also prefer a proper Python object.  I'd also like to be able to use the lambda test console, but currently I can't as it passes its input differently.</p>
  
  <p>Is there a configuration switch I'm missing which will force API Gateway to serialize the request body (as well as all other params) as a python <code>dict</code> or proper object?  The <a href="http://docs.aws.amazon.com/lambda/latest/dg/python-programming-model-handler-types.html" rel="noreferrer">documentation</a> on the specifics of what is passed is sparse, stating:</p>
  
  <blockquote>
    <p>event – AWS Lambda uses this parameter to pass in event data to the handler. This parameter is usually of the Python dict type. It can also be list, str, int, float, or NoneType type.</p>
  </blockquote>
  
  <p>I get that this blurb covers what I'm seeing, but it's not exactly helpful.</p>