Hi everyone,
I run into the following problem when implementing RESTful API.
I have this function in my controller:
@request.restful()
def prop():
response.view = 'generic.json'
session.forget(response)
def POST(**vars):
return dict()
return locals()
When I use cURL with valid JSON body like this one:
# curl -H "Content-Type: application/json" -d '{"client_id": 112233}'
https://domain.org/api/prop
<https://domain.org/api/prop>
I get "invalid arguments" response.
<https://domain.org/api/prop>
When I send invalid JSON in request body, I get empty JSON ("{}") in
response, which I assume is OK.
Can you please advice where could possibly be a problem?
I run web2py 2.9.11 on Apache and Python 2.6.1.
Thank you,
Tomas
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.