UNPKG
bunr6statapi
Version:
latest (2.0.1)
2.0.1
2.0.0
Wrapper for Rainbow Six Siege API
github.com/CalumW1/R6StatAPI
CalumW1/R6StatAPI
bunr6statapi
/
src
/
methods
/
apiClient.ts
13 lines
(10 loc)
•
284 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
export const ApiClient = async (url: string, header: any,
method
:
string
):
Promise
<
any
> =>
{ const response = await fetch(url, {
method
:
method
,
headers
:
header
, })
;
if
(!response.ok) { throw new Error(
'Error with response'
); }
return
response; };