Daniel Fetchinson schrieb:
>> Can i submit a JSON object to my Turbogears?
> 
> Yes.
> 
>> I am making an ajax request (POST method) to the server.
>> The request body contains json object?
> 
> Each variable in the POST request gets translated to an argument of
> your controller method. What you do with them is entirely up to you,
> you may reconstruct the original json object if you want with the help
> of the python simplejson or json modules.
> 
>> How do i access this json ibject in my controller?
> 
> In the same way as you would access any other argument to your
> controller method.

This is not necessarily true. The "normal" way of passing variables 
would pass an urlencoded key-value-pair. However, it's perfectly 
possible to not do that (and that's what I'm understanding from the OP) 
to pass a binary chunk of data that is *not* url-encoded.

According to some docs

(http://books.google.de/books?id=40KiO6A-_9cC&pg=PA44&lpg=PA44&dq=pylons+request+post&source=bl&ots=VrtOiaRs4c&sig=_oRYuHMNTV3raRpDg7E2bJ_GfYI&hl=de&ei=BKNTSqq6IoGqngPr0uUE&sa=X&oi=book_result&ct=result&resnum=3)

this should be accessible using

   from tg import request


   request.body

But I didn't try that.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to