Skip to content

Commit 1155db0

Browse files
committed
Update request.ts
1 parent eaa131f commit 1155db0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/structures/request.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
import axios, { AxiosRequestConfig } from "axios";
1+
import axios, { AxiosRequestConfig, Method } from "axios";
22

33
export default async <T>(
44
url: string,
5+
token: string,
6+
method: Method,
57
options: AxiosRequestConfig
68
): Promise<T> => {
79
return await axios
810
.request<T>({
911
url,
12+
method,
13+
headers: {
14+
"content-type": "application/json",
15+
accept: "application/vnd.github.v3+json",
16+
Authorization: `Bearer ${token}`,
17+
},
1018
...options,
1119
})
1220
.then((response) => {

0 commit comments

Comments
 (0)