web.py: how to get POST parameter and GET parameter?

前端 未结 1 780
误落风尘
误落风尘 2021-02-08 10:18

I\'m new to web.py. I used PHP alot. In PHP, POST parameter and GET parameter is stored in different global variables

For example:

curl http:/

相关标签:
1条回答
  • 2021-02-08 10:41

    There's actually an (undocumented?) _method parameter that can be get, post or both (the default) to return variables from the different sources. See the source for web.input(). So for example:

    get_input = web.input(_method='get')
    post_input = web.input(_method='post')
    

    However, I've used web.py a lot, and never needed this. Why do you need to distinguish between input parameters in the query string and the data?

    0 讨论(0)
提交回复
热议问题