mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
curl create plugin with inputs (#3573)
This commit is contained in:
@@ -27,12 +27,18 @@ export const parseCurl = (curlContent: string) => {
|
||||
type: 'string'
|
||||
}));
|
||||
const newBody = JSON.stringify(parsed.data, null, 2);
|
||||
const bodyArray = Object.keys(parsed.data || {}).map((key) => ({
|
||||
key,
|
||||
value: parsed.data?.[key],
|
||||
type: 'string'
|
||||
}));
|
||||
|
||||
return {
|
||||
url: parsed.url,
|
||||
method: methodMap[parsed.method?.toLowerCase() as RequestMethod] || 'GET',
|
||||
params: newParams,
|
||||
headers: newHeaders,
|
||||
body: newBody
|
||||
body: newBody,
|
||||
bodyArray
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user