On Friday, August 5, 2022 at 6:52:00 PM UTC-7 Dave S wrote:
> On Wednesday, August 3, 2022 at 12:27:11 PM UTC-7 Vlad wrote: > >> If the following is exposed: >> >> @service.json >> def test(a, b): >> .... >> >> it works just fine when I submit url?a=val1;b=val2 >> >> but when I submit a dictionary - {"a":"val1", "b":val2"} - I can't figure >> out how to catch the parameters in the function test() - it gives an error >> that they are missing. >> >> I am not fully controlling the client that does the request - I am just >> giving this client url and the dictionary containing parameters. >> >> on the server side - i.e. in test() - how do I figure out what exactly >> the client is doing - how exactly the parameters are passed so that I could >> read and process them in test()? >> > > > I get an "unexpected keyword argument" exception if I try to use the > dictionary in the url. The manual only describes 2 syntaxes: > the test?a=val1&b=val2 version (note, '&' not ';'), and using > test/val1/val2. > > request.args is ['json', 'test'] for the first form, and ['json', 'test', > 'val1', 'val2'] for the second. > request.vars <Storage {'a': 'val1', 'b': 'val2'}> and <Storage {}> respectively. > > <URL: > http://web2py.com/books/default/chapter/29/10/services#Remote-procedure-calls > > > > /dps > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/71076817-c275-451d-a395-58295f598550n%40googlegroups.com.