From 7d402239735fa994acc5c998436fa0661b7291b5 Mon Sep 17 00:00:00 2001 From: wenxianping <931128603@qq.com> Date: Tue, 23 Jan 2018 17:58:17 +0800 Subject: [PATCH] fix --- myUrllib/httpUtils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/myUrllib/httpUtils.py b/myUrllib/httpUtils.py index 259950f..356b0b4 100644 --- a/myUrllib/httpUtils.py +++ b/myUrllib/httpUtils.py @@ -79,7 +79,7 @@ class HTTPClient(object): def send(self, url, data=None, **kwargs): """send request to url.If response 200,return response, else return None.""" allow_redirects = False - error_data = {"code": 99999, "data": ""} + error_data = {"code": 99999, "message": "重试次数达到上限"} if data: method = "post" self.setHeaders({"Content-Length": "{0}".format(len(data))}) @@ -107,3 +107,4 @@ class HTTPClient(object): return error_data else: sleep(0.1) + return error_data