How do you read post variables in python-eve?
Question: How do we read post variables in python-eve ?

If I do

    
    
    curl -d [ {"firstname" : "Barack", "lastname":"Obama"} ] <url>
    

how would I read post variables[firstname and lastname] inside the program ?

Thanks !


Answer: I post this with the caveat that you are probably not defining and requesting
your resources correctly.

This makes your freshly posted values available in a list named 'items'

    
    
    from eve import Eve
    
    def read_insert(resource, items):
      print 'resource: "%s"' % resource
      print 'items: "%s"' % items
      pass
    
    if __name__ == '__main__':
      app = Eve()
      app.on_insert += read_insert
    
      app.run()
    

