[web2py] Re: Not receiving post_vars from external service webhook

2016-03-07 Thread Lisandro
Thank you very much Anthony and Niphlod for your help. I could rewrite my function to read the post JSON like this: def sparkpost_message_opened(): from gluon.contrib import simplejson post_data = simplejson.load(request.body) # notice it's load() and not loads() # here I can succesf

[web2py] Re: Not receiving post_vars from external service webhook

2016-03-07 Thread Niphlod
it's sending a json as a post content, not the usual form data that is automatically parsed. you'd get automatic request.post_vars reconstruction with json ONLY if they posted an object, but instead they're posting an array of objects (notice the [ ] at top and bottom). web2py (or anything, for

[web2py] Re: Not receiving post_vars from external service webhook

2016-03-07 Thread Lisandro
Thanks for the tip. I've done some tests, and I've found some details that could point the problem. I'm sending a test post to my app url, from SparkPost web app. SparkPost tells me that it will send this post: POST /ws/sparkpost_message_opened HTTP/1.1 Host: x.com.ar Content-Type: app

[web2py] Re: Not receiving post_vars from external service webhook

2016-03-07 Thread Anthony
request.vars, request.post_vars, and request.get_vars are properties (and their values are filled in lazily upon first access), so they are ignored by BEAUTIFY (which only includes attributes found in request.keys()). If you want the entire request object, you could try the trick used in respon