Dude!!! Thanks a lot!!! It worked like expected...
Just for the record, in case someone face this problem.
I set it up like suggested:
def POST(*args, **vars):
if (some_controller_method(
vars['
entry_value'
])):
print "The Output"
print str(
vars['
entry_value'
])
else:
do_something_else()
Using curl in terminal used something like this:
curl --user us...@server.org:thepass -d "
entry_value=the_value"
http://127.0.0.1:8000/appname/default/api/entries.jsonOutput at server terminal instance debugging messages, in case web2py.py was executed in terminal.
The Ouptut
the_valueAs followed in:
http://www.web2pyslices.com/slice/show/1534/restful-services-with-curl-andor-pythonSuddenly I raised a doubt... Which one is better secure practice, the POST API function with the auth required and subsequent functions for the server to do... Or, customized methods that catch the raw info via XML for example. Which one is in security context, better.
P.D: Sorry if it bothers, but how can someone distinguish between explicit or implicit JSON usage? I ask this because of the HTTP protocol and its relation with JSON usage, headers, processed info, tools that process information as XML, JSON, etc... And as we can se here and in the tutorial showed, the only thing related with JSON is the final part of the URL.
Peace for all of you fellows! C: