diff --git a/web/app/components/workflow/nodes/http/components/edit-body/index.tsx b/web/app/components/workflow/nodes/http/components/edit-body/index.tsx index 301ab81c92..6441f8f8e5 100644 --- a/web/app/components/workflow/nodes/http/components/edit-body/index.tsx +++ b/web/app/components/workflow/nodes/http/components/edit-body/index.tsx @@ -63,9 +63,19 @@ const EditBody: FC = ({ const handleTypeChange = useCallback((e: React.ChangeEvent) => { const newType = e.target.value as BodyType + const hasKeyValue = [BodyType.formData, BodyType.xWwwFormUrlencoded].includes(newType) onChange({ type: newType, - data: [], + data: hasKeyValue + ? [ + { + id: uniqueId(UNIQUE_ID_PREFIX), + type: BodyPayloadValueType.text, + key: '', + value: '', + }, + ] + : [], }) }, [onChange])