【发布时间】:2018-05-19 23:14:06
【问题描述】:
我正在尝试使用 pycurl 发出发布请求,但请求在 c.perform() 上无限挂起。我的代码是:
try:
from io import BytesIO
except ImportError:
from io import StringIO as BytesIO
buffer = BytesIO()
self.c.setopt(self.c.URL, 'http://pycurl.io/')
self.c.setopt(self.c.HEADER, 0)
self.c.setopt(self.c.POST, 1)
self.c.perform()
self.c.close()
body = buffer.getvalue()
status = self.c.getinfo(self.c.HTTP_CODE)
response_data = {
'is_fed_successfully': True
}'
为了清楚起见,没有错误。请求只是无限挂起,没有任何响应。
【问题讨论】:
-
pycurl.Curl()在哪里? -
self.c = pycurl.Curl()在类的方法中
标签: python-3.x flask pycurl