MCPcopy Create free account
hub / github.com/VirtualHotBar/NetMount / openlist_api_get

Function openlist_api_get

src/utils/openlist/request.ts:114–133  ·  view source on GitHub ↗

* OpenList API GET 请求

(path: string, queryData?: object)

Source from the content-addressed store, hash-verified

112 * OpenList API GET 请求
113 */
114async 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 请求

Callers 6

reupOpenlistVersionFunction · 0.90
reupStorageFunction · 0.90
getStorageParamsFunction · 0.90

Calls 3

buildFullPathFunction · 0.85
wrapApiCallFunction · 0.85
handleApiResponseFunction · 0.70

Tested by

no test coverage detected