How are POST and GET variables handled in Python?

前端 未结 6 623
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 11:59

In PHP you can just use $_POST for POST and $_GET for GET (Query string) variables. What\'s the equivalent in Python?

6条回答
  •  借酒劲吻你
    2020-11-22 12:39

    Python is only a language, to get GET and POST data, you need a web framework or toolkit written in Python. Django is one, as Charlie points out, the cgi and urllib standard modules are others. Also available are Turbogears, Pylons, CherryPy, web.py, mod_python, fastcgi, etc, etc.

    In Django, your view functions receive a request argument which has request.GET and request.POST. Other frameworks will do it differently.

提交回复
热议问题