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

Function rclone_api_get

src/utils/rclone/request.ts:175–195  ·  view source on GitHub ↗

* Rclone API GET 请求

(
  path: string,
  ignoreError?: boolean
)

Source from the content-addressed store, hash-verified

173 * Rclone API GET 请求
174 */
175async function rclone_api_get(
176 path: string,
177 ignoreError?: boolean
178): Promise<RcloneApiResponse | undefined> {
179 const fullPath = buildApiUrl(path)
180
181 try {
182 const res = await fetch(fullPath, {
183 method: 'GET',
184 headers: getRcloneApiHeaders(),
185 })
186
187 const data = await handleApiResponse(res, fullPath, 'GET')
188 return data
189 } catch (error) {
190 if (!ignoreError) {
191 await printError(error as Error | Response)
192 }
193 return undefined
194 }
195}
196
197// 异步任务响应接口
198interface AsyncJobResponse {

Callers

nothing calls this directly

Calls 4

buildApiUrlFunction · 0.85
getRcloneApiHeadersFunction · 0.85
printErrorFunction · 0.85
handleApiResponseFunction · 0.70

Tested by

no test coverage detected