Skip to content

Commit 8d2b9cc

Browse files
authored
Merge pull request #554 from Yongtae723/fix_bug/curl_command
add -H "Content-Type: application/json" in curl command
2 parents 50df04d + 6804216 commit 8d2b9cc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/ui/src/views/chatflows/APICodeDialog.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ query({"question": "Hey, how are you?"}).then((response) => {
207207
} else if (codeLang === 'cURL') {
208208
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
209209
-X POST \\
210-
-d '{"question": "Hey, how are you?"}'`
210+
-d '{"question": "Hey, how are you?"}' \\
211+
-H "Content-Type: application/json"`
211212
}
212213
return ''
213214
}
@@ -252,6 +253,7 @@ query({"question": "Hey, how are you?"}).then((response) => {
252253
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
253254
-X POST \\
254255
-d '{"question": "Hey, how are you?"}' \\
256+
-H "Content-Type: application/json" \\
255257
-H "Authorization: Bearer ${selectedApiKey?.apiKey}"`
256258
}
257259
return ''
@@ -322,7 +324,8 @@ query(formData).then((response) => {
322324
`
323325
} else if (codeLang === 'cURL') {
324326
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
325-
-X POST \\${getConfigExamplesForCurl(configData, 'formData')}`
327+
-X POST \\${getConfigExamplesForCurl(configData, 'formData')} \\
328+
-H "Content-Type: multipart/form-data"`
326329
}
327330
return ''
328331
}
@@ -369,6 +372,7 @@ query(formData).then((response) => {
369372
} else if (codeLang === 'cURL') {
370373
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
371374
-X POST \\${getConfigExamplesForCurl(configData, 'formData')} \\
375+
-H "Content-Type: multipart/form-data" \\
372376
-H "Authorization: Bearer ${selectedApiKey?.apiKey}"`
373377
}
374378
return ''
@@ -419,7 +423,8 @@ query({
419423
} else if (codeLang === 'cURL') {
420424
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
421425
-X POST \\
422-
-d '{"question": "Hey, how are you?", "overrideConfig": {${getConfigExamplesForCurl(configData, 'json')}}'`
426+
-d '{"question": "Hey, how are you?", "overrideConfig": {${getConfigExamplesForCurl(configData, 'json')}}' \\
427+
-H "Content-Type: application/json"`
423428
}
424429
return ''
425430
}
@@ -472,6 +477,7 @@ query({
472477
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
473478
-X POST \\
474479
-d '{"question": "Hey, how are you?", "overrideConfig": {${getConfigExamplesForCurl(configData, 'json')}}' \\
480+
-H "Content-Type: application/json" \\
475481
-H "Authorization: Bearer ${selectedApiKey?.apiKey}"`
476482
}
477483
return ''

0 commit comments

Comments
 (0)