|
|
@@ -24,8 +24,8 @@ class ApiRequestService {
|
|
|
*/
|
|
|
public async get(
|
|
|
url: string,
|
|
|
- query: AssociativeArray | null = null,
|
|
|
- headers: AssociativeArray | null = null,
|
|
|
+ query: AssociativeArray | string[] | null = null,
|
|
|
+ headers: Record<string, string> | null = null,
|
|
|
) {
|
|
|
return await this.request(HTTP_METHOD.GET, url, null, query, headers)
|
|
|
}
|
|
|
@@ -41,8 +41,8 @@ class ApiRequestService {
|
|
|
public async post(
|
|
|
url: string,
|
|
|
body: string | AnyJson | null = null,
|
|
|
- query: AssociativeArray | null = null,
|
|
|
- headers: AssociativeArray | null = null,
|
|
|
+ query: AssociativeArray | string[] | null = null,
|
|
|
+ headers: Record<string, string> | null = null,
|
|
|
) {
|
|
|
return await this.request(HTTP_METHOD.POST, url, body, query, headers)
|
|
|
}
|
|
|
@@ -58,8 +58,8 @@ class ApiRequestService {
|
|
|
public async put(
|
|
|
url: string,
|
|
|
body: string | AnyJson | null = null,
|
|
|
- query: AssociativeArray | null = null,
|
|
|
- headers: AssociativeArray | null = null,
|
|
|
+ query: AssociativeArray | string[] | null = null,
|
|
|
+ headers: Record<string, string> | null = null,
|
|
|
) {
|
|
|
return await this.request(HTTP_METHOD.PUT, url, body, query, headers)
|
|
|
}
|
|
|
@@ -75,8 +75,8 @@ class ApiRequestService {
|
|
|
public async patch(
|
|
|
url: string,
|
|
|
body: string | AnyJson | null = null,
|
|
|
- query: AssociativeArray | null = null,
|
|
|
- headers: AssociativeArray | null = null,
|
|
|
+ query: AssociativeArray | string[] | null = null,
|
|
|
+ headers: Record<string, string> | null = null,
|
|
|
) {
|
|
|
return await this.request(HTTP_METHOD.PATCH, url, body, query, headers)
|
|
|
}
|
|
|
@@ -90,8 +90,8 @@ class ApiRequestService {
|
|
|
*/
|
|
|
public async delete(
|
|
|
url: string,
|
|
|
- query: AssociativeArray | null = null,
|
|
|
- headers: AssociativeArray | null = null,
|
|
|
+ query: AssociativeArray | string[] | null = null,
|
|
|
+ headers: Record<string, string> | null = null,
|
|
|
) {
|
|
|
return await this.request(HTTP_METHOD.DELETE, url, null, query, headers)
|
|
|
}
|
|
|
@@ -110,8 +110,8 @@ class ApiRequestService {
|
|
|
method: HTTP_METHOD,
|
|
|
url: string,
|
|
|
body: string | AnyJson | null = null,
|
|
|
- query: AssociativeArray | null = null,
|
|
|
- headers: AssociativeArray | null = null,
|
|
|
+ query: AssociativeArray | string[] | null = null,
|
|
|
+ headers: Record<string, string> | null = null,
|
|
|
): Promise<Response> {
|
|
|
const config: FetchOptions = { method }
|
|
|
if (query) {
|