add -H "Content-Type: application/json" in curl command

This commit is contained in:
Yongtae
2023-07-16 17:59:25 +09:00
parent ab0534169c
commit b5a41be7db
@@ -204,7 +204,8 @@ query({"question": "Hey, how are you?"}).then((response) => {
} else if (codeLang === 'cURL') {
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
-X POST \\
-d '{"question": "Hey, how are you?"}'`
-d '{"question": "Hey, how are you?"}' \\
-H "Content-Type: application/json"`
}
return ''
}
@@ -246,6 +247,7 @@ query({"question": "Hey, how are you?"}).then((response) => {
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
-X POST \\
-d '{"question": "Hey, how are you?"}' \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer ${selectedApiKey?.apiKey}"`
}
return ''
@@ -316,7 +318,8 @@ query(formData).then((response) => {
`
} else if (codeLang === 'cURL') {
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
-X POST \\${getConfigExamplesForCurl(configData, 'formData')}`
-X POST \\${getConfigExamplesForCurl(configData, 'formData')} \\
-H "Content-Type: application/json"`
}
return ''
}
@@ -363,6 +366,7 @@ query(formData).then((response) => {
} else if (codeLang === 'cURL') {
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
-X POST \\${getConfigExamplesForCurl(configData, 'formData')} \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer ${selectedApiKey?.apiKey}"`
}
return ''
@@ -410,7 +414,8 @@ query({
} else if (codeLang === 'cURL') {
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
-X POST \\
-d '{"question": "Hey, how are you?", "overrideConfig": {${getConfigExamplesForCurl(configData, 'json')}}'`
-d '{"question": "Hey, how are you?", "overrideConfig": {${getConfigExamplesForCurl(configData, 'json')}}' \\
-H "Content-Type: application/json"`
}
return ''
}
@@ -460,6 +465,7 @@ query({
return `curl ${baseURL}/api/v1/prediction/${dialogProps.chatflowid} \\
-X POST \\
-d '{"question": "Hey, how are you?", "overrideConfig": {${getConfigExamplesForCurl(configData, 'json')}}' \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer ${selectedApiKey?.apiKey}"`
}
return ''