* OpenList API GET 请求
(path: string, queryData?: object)
| 112 | * OpenList API GET 请求 |
| 113 | */ |
| 114 | async function openlist_api_get(path: string, queryData?: object): Promise<ApiResponse> { |
| 115 | const fullPath = buildFullPath(path, queryData) |
| 116 | |
| 117 | return wrapApiCall( |
| 118 | async () => { |
| 119 | const headers: Record<string, string> = {} |
| 120 | if (openlistInfo.endpoint.auth.token) { |
| 121 | headers['Authorization'] = openlistInfo.endpoint.auth.token |
| 122 | } |
| 123 | const res = await fetch(fullPath, { |
| 124 | method: 'GET', |
| 125 | redirect: 'follow', |
| 126 | headers, |
| 127 | }) |
| 128 | return handleApiResponse(res, fullPath, 'GET') |
| 129 | }, |
| 130 | fullPath, |
| 131 | 'GET' |
| 132 | ) |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * OpenList API POST 请求 |
no test coverage detected