开发者

Are there any open-source references for the web2py remote-procedure-calls?

开发者 https://www.devze.com 2023-03-21 07:51 出处:网络
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 ve

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

精彩评论

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

关注公众号