Skip to content

Commit b00daf9

Browse files
committed
fix: set method to POST when body exists (#14523)
1 parent 55405c1 commit b00daf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/app/components/workflow/nodes/http/components/curl-panel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const parseCurl = (curlCommand: string): { node: HttpNodeType | null; error: str
2222
const node: Partial<HttpNodeType> = {
2323
title: 'HTTP Request',
2424
desc: 'Imported from cURL',
25-
method: Method.get,
25+
method: undefined,
2626
url: '',
2727
headers: '',
2828
params: '',
@@ -52,6 +52,7 @@ const parseCurl = (curlCommand: string): { node: HttpNodeType | null; error: str
5252
if (i + 1 >= args.length)
5353
return { node: null, error: 'Missing data value after -d, --data, --data-raw, or --data-binary.' }
5454
node.body = { type: BodyType.rawText, data: args[++i].replace(/^['"]|['"]$/g, '') }
55+
node.method = node.method || Method.post
5556
break
5657
case '-F':
5758
case '--form': {

0 commit comments

Comments
 (0)