Python-Requests超时不兼容

时间:2016-10-29 00:42:55

标签: python python-requests

我准备放弃并用cURL做所有事情。

使用python 2.7.12 :: Anaconda 4.1.1和python-requests 2.11.1我无法发送任何请求。 无论是暂停超时还是将其指定为int,float或tuple,我得到" ValueError('超时值连接是超时(连接= 70,读= 70,总计) =无),但必须是int或float')。

我已经读过类似的问题,这可能是旧版本的python或请求的问题,但我有两者的最新版本。我还尝试将请求降级到以前的版本(2.9.1),但错误仍然存​​在。请求库是否在本地中断?我应该在urllib中这样做吗?

data = {
    'description': 'customer for account: ' + str(account_id),
    'email': email,
    'source': token
}

customer = requests.post('https://api.stripe.com/v1/customers', data=data, auth=('sk_test_mykey', ''), timeout=70)

0 个答案:

没有答案
相关问题