grequests.post()返回None

时间:2017-07-21 13:10:32

标签: python grequests

>>> payload = {'a': 'b'}
>>> url = 'http://someurl/'
>>> req_ = [grequests.post(url, session=requests.session, data=payload)]
>>> r = grequests.map(req_)
>>> r
[None]
我做错了什么?

1 个答案:

答案 0 :(得分:1)

您需要传递会话实例而不是会话类:

>>> session = requests.session()
>>> req_ = [grequests.post(url, session=session, data=payload)]