Thanks very much for your help Niphlod.
On Wednesday, 14 November 2012 16:10:35 UTC-5, Niphlod wrote:
>
>
> Yes I understand your point. The reason it is currently like this is
>> because if I use your suggestion (which I obviously had originally)
>>
>> {"id": 1, "method": "savemessage", "params": { "*message*":
>> "variableholdingmessage", "*uid*" : "variableholdingmail"}}
>>
>> I get message and uid as the values in the DB. So I switched them.
>>
>> {"id": 1, "method": "savemessage", "params": { "variableholdingmessage":
>> "mymessage", "variableholdinguid" : "myemail@localhost"}}
>>
>> The result means that variableholdingmessage is saved as the message and
>> not the expected "mymessage". Exactly the same for uid.
>>
>> Unfortunately jsonrpc call method has a bug. in web2py 2.2.1, in
> gluon/tools.py, line 4231 should be
>
> s = methods[method](**params)
>
> instead of
>
> s = methods[method](*params)
>
>
> sending a patch to Massimo right now!
>
>
>>
>> re: PS -- haha yes I know. I did try it with single quotes and it crapped
>> out?? So just kept the doubles. It's not that bad!
>>
>> re: PS2 -- have you any recommendations to solve this special character
>> potential problem?
>>
>>
> Normally with jsonrpc you use something that is not curl, e.g. a
> programming language that supports json (python?!)
> Escaping on bash without awk, sed, etc is always problematic.... but if
> you're willing to have as only limitation the " character that is less
> frequent to use within a message, why don't you use one of the methods not
> requiring a json body to be posted ? e.g. @service.xml, @service.csv or
> @service.json....
>
> curl -v --get --data-urlencode \"uid=$uid\" --data-urlencode
> \"message=$message\" $url
>
> here curl takes care of urlencoding the message and the uid parameters.
>
>
>
>
--