feat(http): text/plain is allowed (#2376)

* feat(http): plan/txt is allowed

* Update http468.ts

* Update http468.ts

* body 添加string类型
This commit is contained in:
折戟沉沙、丿
2024-08-16 10:03:43 +08:00
committed by GitHub
parent 5545e84bb9
commit 5bf0dd0ef1
2 changed files with 5 additions and 2 deletions

View File

@@ -111,6 +111,9 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
if (!httpJsonBody) return {};
try {
httpJsonBody = replaceVariable(httpJsonBody, allVariables);
if (headers['Content-Type']?.includes('text/plain')) {
return httpJsonBody?.replaceAll(UNDEFINED_SIGN, 'null');
}
const jsonParse = JSON.parse(httpJsonBody);
const removeSignJson = removeUndefinedSign(jsonParse);
return removeSignJson;
@@ -196,7 +199,7 @@ async function fetchData({
method: string;
url: string;
headers: Record<string, any>;
body: Record<string, any>;
body: Record<string, any> | string;
params: Record<string, any>;
}) {
const { data: response } = await axios({