Skip to content

Commit

Permalink
Fix content-type for json
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddd committed May 13, 2021
1 parent 3b620a9 commit e1b02de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ export async function makeRequest(request: types.Request) {
}
if (body) {
if (typeof (body) == "string") {
requestInit.headers['Content-Type'] = 'application/x-www-form-urlencoded';
requestInit.headers['Content-Type'] = 'application/json';
} else if (body instanceof URLSearchParams) {
requestInit.headers['Content-Type'] = 'application/x-www-form-urlencoded';
} else if (body instanceof FormData) {
requestInit.headers['Content-Type'] = 'application/x-www-form-urlencoded';
}
requestInit.body = body;
}
Expand Down

0 comments on commit e1b02de

Please sign in to comment.