initital commit

This commit is contained in:
Lee
2024-04-14 21:11:46 +01:00
parent 5876f13f70
commit eb0facd38e
25 changed files with 3120 additions and 0 deletions

18
src/common/WebRequest.ts Normal file
View File

@ -0,0 +1,18 @@
import axios, { AxiosResponse } from "axios";
export default class WebRequest {
/**
* Gets a response from the given URL.
*
* @param url the url
* @returns the response
*/
public static get(url: string): Promise<AxiosResponse<any, any>> {
return axios.get(url, {
validateStatus: () => true, // Don't throw errors
headers: {
"User-Agent": "McUtils-JS-Library/1.0",
},
});
}
}