forked from DxvLwRYF/apiAutoTest
解决捕获到响应结果无法被序列化的请求报错问题
This commit is contained in:
parent
780561777a
commit
c1346cafc2
|
@ -6,7 +6,7 @@
|
|||
@Author:zy7y
|
||||
@Date :2021/5/21 22:07
|
||||
@Desc : 录制接口,生成用例文件
|
||||
基于mitmproxy实现
|
||||
基于mitmproxy实现,会包含css/html/png等后缀链接
|
||||
参考资料:
|
||||
https://blog.wolfogre.com/posts/usage-of-mitmproxy/
|
||||
https://www.cnblogs.com/liuwanqiu/p/10697373.html
|
||||
|
@ -80,9 +80,12 @@ class Counter:
|
|||
data = url.split('?')[1]
|
||||
data = self.handle_form(data)
|
||||
# 预期结果
|
||||
try:
|
||||
expect = json.dumps(
|
||||
{".": json.loads(flow.response.text)}, ensure_ascii=False)
|
||||
|
||||
except Exception as e:
|
||||
ctx.log.error(e)
|
||||
expect = '{}'
|
||||
# 日志
|
||||
ctx.log.info(url)
|
||||
ctx.log.info(header)
|
||||
|
|
Loading…
Reference in New Issue