开发者

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()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜