The data will be in request.vars, not request.args.
Anthony
On Friday, January 11, 2013 10:28:27 AM UTC-5, yn yn wrote:
>
> Thanks for the answer...
> Ok
> I have tested jQuery.post('{{=URL('default',
> 'testpost')}}',{'key':'hello'})
>
> where in default.py there is a def:
>
> def testpost():
> import os
> data = request.args(0)
> myfile = os.path.join(request.folder, 'static', 'file1.txt')
> f = open(myfile, "w")
> f.write(data)
> f.close()
> return dict()
>
> I can open the file1.txt but nothing is writing there. I think 'hello' is
> not transmited ... isn'it it? do you know what is wrong?
>
>
>
> El viernes, 11 de enero de 2013 15:13:29 UTC+1, Massimo Di Pierro escribió:
>>
>> I suggest using jquery.post
>>
>> jQuery.post('{{=URL('testfunction')}}',{'key':'value'})
>>
>> {'key':'value'} is a js dictionary, can be anything you like and tehy
>> will be passed as vars properly escaped.
>>
>>
>>
>>
--