V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
gobetago
V2EX  ›  Python

Python 用 post 提交数据时 如何提交原始数据?

  •  
  •   gobetago · 2018-08-03 12:45:55 +08:00 · 2311 次点击
    这是一个创建于 2094 天前的主题,其中的信息可能已经有所发展或是发生改变。

    直接抓包提交的数据时 Ptfmx6PQ==

    用 python requests.post 提交数据后 就自动 url 编码为 Ptfmx6PQ%3D%3D

    4 条回复    2018-08-03 14:35:07 +08:00
    julyclyde
        1
    julyclyde  
       2018-08-03 14:23:07 +08:00
    无所谓啊,等收到之后就解码了
    KeatingSmith
        2
    KeatingSmith  
       2018-08-03 14:29:59 +08:00
    from urllib.parse import unquote

    url = unquote(url)
    KeatingSmith
        3
    KeatingSmith  
       2018-08-03 14:30:29 +08:00
    在服务器端解码
    TommyLemon
        4
    TommyLemon  
       2018-08-03 14:35:07 +08:00
    Form 会编码,需要后端解码,改用 JSON 提交就好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2978 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 13:26 · PVG 21:26 · LAX 06:26 · JFK 09:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.