From ab6aae4684fc3f7d1b9fcd8408997175f4c4f13d Mon Sep 17 00:00:00 2001 From: chras-fu Date: Wed, 1 Nov 2023 17:46:25 +0800 Subject: [PATCH] =?UTF-8?q?api=E7=94=A8=E4=BE=8B=E5=90=8E=E7=BD=AE?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87res=5Freq?= =?UTF-8?q?uest=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/api/teststep.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/api/teststep.py b/core/api/teststep.py index 3fa0a81..a689338 100644 --- a/core/api/teststep.py +++ b/core/api/teststep.py @@ -31,6 +31,7 @@ def __init__(self, test, session, collector, context, params): self.params = params self.test = test self.status_code = None + self.response_request = None self.response_headers = None self.response_content = None self.response_content_bytes = None @@ -79,6 +80,7 @@ def execute(self): else: res = request(self.collector.method, url, **self.collector.others) end_time = datetime.datetime.now() + self.response_request = res.request self.test.recordTransDuring(int((end_time-start_time).microseconds/1000)) self.save_response(res) response_log = '【响应信息】:
' @@ -157,6 +159,7 @@ def sys_get(name): raise KeyError("不存在的公共参数或关联变量: {}".format(name)) names = locals() + names["res_request"] = self.response_request names["res_code"] = self.status_code names["res_header"] = self.response_headers names["res_data"] = self.response_content