Merge pull request #555 from Yongtae723/fix_bug/javascript_command
Refactor API request to include Content-Type header
This commit is contained in:
commit
50df04d382
|
|
@ -190,7 +190,10 @@ output = query({
|
||||||
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: data
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
body: JSON.stringify(data)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
@ -229,9 +232,12 @@ output = query({
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
||||||
{
|
{
|
||||||
headers: { Authorization: "Bearer ${selectedApiKey?.apiKey}" },
|
headers: {
|
||||||
|
Authorization: "Bearer ${selectedApiKey?.apiKey}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: data
|
body: JSON.stringify(data)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
@ -392,7 +398,10 @@ output = query({
|
||||||
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: data
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
body: JSON.stringify(data)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
@ -439,9 +448,12 @@ output = query({
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
"${baseURL}/api/v1/prediction/${dialogProps.chatflowid}",
|
||||||
{
|
{
|
||||||
headers: { Authorization: "Bearer ${selectedApiKey?.apiKey}" },
|
headers: {
|
||||||
|
Authorization: "Bearer ${selectedApiKey?.apiKey}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: data
|
body: JSON.stringify(data)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue