In jQuery, if you do:
data: {json1: JSON.stringify([1, 2, 3])},
contentType: 'application/json'
Then in the controller, request.post_vars.json1 will be the Python list, [1,
2, 3] -- no need to do any JSON conversion on the server side. Note, the
JSON must be an object with keys, not
hey all and anthony,
i've tried a bunch of things, including your suggestion above. here are my
results and this is using web2py 2.16.1. on the client side, under the
view's header, i have:
a = getArray();
//displays the grabbed array
Please show your code and its results. If you post JSON with contenttype
'application/json', request.post_vars should end up being the JSON
converted to a Python data structure.
Anthony
On Saturday, February 3, 2018 at 9:08:00 AM UTC-5, lucas wrote:
>
> hello one and all,
>
> I know that
perhaps you can use restful web service
ref:
http://web2py.com/books/default/chapter/29/10/services#Restful-Web-Services
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
4 matches
Mail list logo