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
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
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
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
4 matches
Mail list logo