我正在使用 requests 发送带有以下代码的 post 请求:
EMAIL=test@test.com
payload = {'ref':'EdX7CqkmjCETTSA9MOPvvmmhLE0OH9_D-zjde6lAKsOoKD8','EMAIL':EMAIL,'tag': 'F41D3B010005FB43'}
post_response = requests.post(url='http://p5trc.emv2.com/D2TTF8', params=payload)
我收到以下异常:
File "C:\Program Files\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\pydevd.py", line 1090, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "C:\Users\USER\workspace\POST_ME\POST_ME.py", line 72, in <module>
post_response = requests.post(url='http://p5trc.emv2.com/D2TTF8', params=payload)
File "C:\Users\USER\workspace\POST_ME\requests\api.py", line 98, in post
return request('post', url, data=data, **kwargs)
File "C:\Users\USER\workspace\POST_ME\requests\safe_mode.py", line 39, in wrapped
return function(method, url, **kwargs)
File "C:\Users\USER\workspace\POST_ME\requests\api.py", line 51, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\USER\workspace\POST_ME\requests\sessions.py", line 268, in request
r.send(prefetch=prefetch)
File "C:\Users\USER\workspace\POST_ME\requests\models.py", line 650, in send
self._build_response(r)
File "C:\Users\USER\workspace\POST_ME\requests\models.py", line 313, in _build_response
request.send()
File "C:\Users\USER\workspace\POST_ME\requests\models.py", line 636, in send
raise ConnectionError(sockerr)
requests.exceptions.ConnectionError: [Errno 11004] getaddrinfo failed
从字符串中删除减号字符EdX7CqkmjCETTSA9MOPvvmmhLE0OH9_D-zjde6lAKsOoKD8
或'tag': 'F41D3B010005FB43'
从字典中删除时,我没有得到异常。
任何想法?