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

Tornado HTTPClient 请求微博 api 403?

  •  
  •   xueweihan ·
    521xueweihan · Dec 16, 2015 · 3331 views
    This topic created in 3825 days ago, the information mentioned may be changed or developed.
    'https://api.weibo.com/2/search/suggestions/users.json?' + urllib.urlencode({'source': 'appkey', 'q': '阿信'})
    请求的 api 如上,我直接用浏览器访问这个 url 可以返回数据,但是如果用 Tornado HTTPClient 请求就返回 403
    3 replies    2015-12-24 12:34:25 +08:00
    dai269619118
        1
    dai269619118  
       Dec 16, 2015
    找个抓取 http 的工具 分别把 2 个 http 请求抓出来对比下 就知道了
    yGin
        2
    yGin  
       Dec 16, 2015
    上次一个也在搞微博 API 的盆友说 用浏览器成功用 postman 却失败
    结果原因是:浏览器登录了微博账户。。。。

    新浪微博自己的调试工具 http://open.weibo.com/tools/console
    xueweihan
        3
    xueweihan  
    OP
       Dec 24, 2015
    @NeusoftGin 您的意思我只带 appkey 请求不行,要先弄成认真登陆状态,搞到 cookie ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2848 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 13:11 · PVG 21:11 · LAX 06:11 · JFK 09:11
    ♥ Do have faith in what you're doing.