Are there any open-source references for the web2py remote-procedure-calls?
Are there any open-source references for the web2py remote procedure calls (i.e. @service.run) to get inf开发者_StackOverflowormation from and post it to a table in the database?
@service.run is not very useful it is more for testing before you move on to xmlrpc or soap or jsonrpc than anything else. You should use a restful interface for what you asked. For example:
db.define_table('mytable,Field('name'))
@request.restful()
def callme():
def GET(id):
return db.mytable(id)
def POST(name):
return db.mytable.insert(name=name)
return locals()
精彩评论