cmmulxuk
V2EX  ›  Flask

flask get 如何获取复杂点的网址啊?

  •  
  •   cmmulxuk · Dec 5, 2015 · 3400 views
    This topic created in 3812 days ago, the information mentioned may be changed or developed.
    url = http://example.com/abc?id=123456&name=ok

    像上面这种网址, flask get 无法获取啊

    用 path 的话,只能获取到域名。
    cmmulxuk
        1
    cmmulxuk  
    OP
       Dec 5, 2015
    忘记交代了,上面的 URL 是作为参数传递的。
    mkeith
        2
    mkeith  
       Dec 5, 2015
    urlencode
    jimzhong
        3
    jimzhong  
       Dec 6, 2015
    urllib.parse 可以解决
    flask 还有一个 request.args 可以用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3611 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 10:39 · PVG 18:39 · LAX 03:39 · JFK 06:39
    ♥ Do have faith in what you're doing.