推荐学习书目
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
zywx
V2EX  ›  Python

今天初用 requests,掉坑里去了,求助~~

  •  
  •   zywx ·
    do-you · Aug 4, 2016 · 3662 views
    This topic created in 3568 days ago, the information mentioned may be changed or developed.
    import requests
    data1='11111111111'
    r = requests.post('http://www.baidu.com', data=data1.encode('utf-8'))

    ubuntu16.04 python3.5.2 requests2.10.0 下
    抓包发现数据包里没数据

    r = requests.post('http://www.baidu.com', data=data1))
    换 python2.7.12 就正常
    Supplement 1  ·  Aug 4, 2016
    抓包发现数据包里没数据,指的是上面传进去的 data1
    Supplement 2  ·  Aug 4, 2016
    问题解决了,我看不到 post 的数据时 wireshark 的问题,用 @bugmeneinhttp://requestb.in 测试是有数据的
    然后坑了我这么久的原来是我调用的两个 api 间服务器限制要有几秒时间间隔,不然一直 limit,一直 limit,一直 limit....
    3 replies    2016-08-04 18:59:47 +08:00
    shyling
        1
    shyling  
       Aug 4, 2016
    试了试没问题= =
    tinyproxy
        2
    tinyproxy  
       Aug 4, 2016 via iPhone
    你都抓包了。。。就看看 HTTP request 跟 response 的报文啊,如果请求报文一模一样,那就是 server 给你返回不同的东西而已
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   933 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:50 · PVG 04:50 · LAX 13:50 · JFK 16:50
    ♥ Do have faith in what you're doing.