|
@@ -5,6 +5,7 @@ import jsonpath
|
|
|
import requests
|
|
|
|
|
|
from common.database_util import DatabaseUtil
|
|
|
+from common.encrypt import genRat
|
|
|
from common.log_util import error_log, logs
|
|
|
from common.yaml_util import write_yaml, read_config_yaml, write_yaml_out_time_url
|
|
|
from random1111 import DubugTalk
|
|
@@ -22,11 +23,14 @@ class RequestUtil:
|
|
|
# 请求方式处理
|
|
|
method = str(method).lower()
|
|
|
# 基础路径拼接以及替换
|
|
|
+ url_old = self.replace_value(url)
|
|
|
url = self.base_url + self.replace_value(url)
|
|
|
# 参数替换
|
|
|
for key, value in kwargs.items():
|
|
|
if key in ['params', 'data', 'json', 'headers']:
|
|
|
kwargs[key] = self.replace_value(value)
|
|
|
+ if key == 'headers':
|
|
|
+ kwargs['headers']["Mi"]= DubugTalk().genRat(url_old)
|
|
|
elif key == 'files':
|
|
|
for file_key, file_path in value.items():
|
|
|
value[file_key] = open(file_path, 'rb')
|
|
@@ -93,6 +97,8 @@ class RequestUtil:
|
|
|
data = data_type(str_data)
|
|
|
return data
|
|
|
|
|
|
+ # def replace_headers(self, data):
|
|
|
+
|
|
|
# 规范yaml文件
|
|
|
def standard_yaml(self, arg_names):
|
|
|
try:
|