add content type form
This commit is contained in:
parent
d5199a6ef1
commit
1cd238b4ab
@ -17,6 +17,8 @@ async function makeAPIRequest(endpoint, body, options={}) {
|
||||
if (options["content"] === 'json') {
|
||||
fetchOptions["headers"]["Content-Type"] = 'application/json'
|
||||
fetchOptions["body"] = JSON.stringify(body)
|
||||
} else if (options["content"] === 'form') {
|
||||
fetchOptions["body"] = body;
|
||||
} else {
|
||||
fetchOptions["body"] = new URLSearchParams(body);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user