Update content-type header to application/x-www-form-urlencoded in APICodeDialog.js

This commit is contained in:
Yongtae
2023-07-17 13:49:16 +09:00
parent 832064634b
commit be49c11f6b
@@ -310,9 +310,9 @@ async function query(formData) {
{ {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/x-www-form-urlencoded"
}, },
body: JSON.stringify(formData) body: new URLSearchParams(formData)
} }
); );
const result = await response.json(); const result = await response.json();
@@ -358,10 +358,10 @@ async function query(formData) {
{ {
headers: { headers: {
Authorization: "Bearer ${selectedApiKey?.apiKey}", Authorization: "Bearer ${selectedApiKey?.apiKey}",
"Content-Type": "application/json" "Content-Type": "application/x-www-form-urlencoded"
}, },
method: "POST", method: "POST",
body: JSON.stringify(formData) body: new URLSearchParams(formData)
} }
); );
const result = await response.json(); const result = await response.json();