def _fetch_initial_data(self):
data = None
headers = httputil.HTTPHeaders({'Content-Type': Core.DATA_MIME_TYPE})
http_client = httpclient.HTTPClient()
try:
response = http_client.fetch(self.__initial_data_url, headers=headers)
data = response.body
except httpclient.HTTPError as e:
# HTTPError is raised for non-200 responses; the response
# can be found in e.response.
print("Error: " + str(e))
except Exception as e:
# Other errors are possible, such as IOError.
print("Error: " + str(e))
finally:
http_client.close()
return data.decode(Core.ENCODING)
websocketclient.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录