JSON isn't Python :)
Of course single quotes was the issue!
I've now got data from my Java GWT client app. I'm using JSON because
JavaScript luvs JSON and GWT overlays makes handling such data very
straightforward.
On Monday, 10 June 2013, Niphlod wrote:
> uhm. web2py handles usual encoded forms in multipart/form-data and
> application/x-www-form-urlencoded without problems. Additionally recent
> releases parse automatically into request.vars all requests that POST a
> json body if they're handled with content-type : application/json.
> Inspect your POSTs with something like firebug to spot the issue you're
> facing.
>
> @david: Posting YAML isn't quite a standard, although preferred to CSV,
> that is the most horrible way to pass around values for forms. CSV is good
> for passing around table data, but is not supported by any browser
> "natively" (i.e. you must build your own CSV serialization)...YAML has the
> exact same issue, but CSV has a major limit... How do you pass two values
> with the same name as {id : [1, 2] } with CSV :-D ?
>
> On Monday, June 10, 2013 7:10:41 PM UTC+2, Derek wrote:
>>
>> Post the whole traceback.
>>
>> Also, I just want to make the comment that what you put here is not valid
>> json...
>> {'POST' : 'query POST'}
>>
>> Single quotes aren't allowed.
>> Verify your json by going here:
>>
>> http://jsonlint.com/
>>
>> Also, before using JSON you might want to read the spec.
>> http://www.json.org/
>>
>> Any reason why you are using JSON? In most cases it's very inefficient.
>> I'd recommend CSV or YAML.
>>
>> On Monday, June 10, 2013 9:54:19 AM UTC-7, Carl wrote:
>>>
>>> I am passing the string {'POST' : 'query POST'} to my Web2py server code.
>>>
>>> Looking at gluon/main/py and tracing into sj.load(body) at line 225
>>> leads to Python/Lib/json/decoder.py but eventually gets to errmsg(),
>>> line 36, with
>>> msg = Expecting proper name.
>>> doc = [{'POST' : 'qwerty POST'}]
>>> pos = 2
>>> end = None
>>>
>>> I bet the answer is obvious (!) but can you point it out?
>>>
>>> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/2bdfZCeRJYU/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> [email protected] <javascript:_e({}, 'cvml',
> 'web2py%[email protected]');>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.