We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaa131f commit 1155db0Copy full SHA for 1155db0
src/structures/request.ts
@@ -1,12 +1,20 @@
1
-import axios, { AxiosRequestConfig } from "axios";
+import axios, { AxiosRequestConfig, Method } from "axios";
2
3
export default async <T>(
4
url: string,
5
+ token: string,
6
+ method: Method,
7
options: AxiosRequestConfig
8
): Promise<T> => {
9
return await axios
10
.request<T>({
11
url,
12
+ method,
13
+ headers: {
14
+ "content-type": "application/json",
15
+ accept: "application/vnd.github.v3+json",
16
+ Authorization: `Bearer ${token}`,
17
+ },
18
...options,
19
})
20
.then((response) => {
0 commit comments