Skip to content

Commit bfdcd64

Browse files
committed
refactor: default request headers
1 parent 3298be1 commit bfdcd64

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/managers/api.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class APIManager {
3939

4040
init.method = init.method || "GET";
4141
init.headers = {
42+
Accept: "application/json",
4243
...(init.headers || {}),
4344
Authorization: this.apiKey,
4445
};
@@ -53,6 +54,10 @@ export class APIManager {
5354

5455
if ("body" in init && init.body && !(init.body instanceof Buffer)) {
5556
init.body = JSON.stringify(init.body);
57+
init.headers = {
58+
...init.headers,
59+
"Content-Type": "application/json",
60+
};
5661
}
5762

5863
return { url, init };

0 commit comments

Comments
 (0)