let apiUrl = this.serverAdress + '/api2/auth-token/';const data = { 'username': this.username, 'password': this.password};let header = { 'Content-Type': 'application/json', 'X-SEAFILE-OTP': totp};const response = await fetch(new Request(apiUrl, { method: 'POST', headers: new Headers(header), body: JSON.stringify(data),}));return response;我收到來自 API 的響應,如下所示,我想將結果解析為 JSON。當我嘗試使用訪問令牌時,await response.json()["token"]我返回未定義。
Javascipt 獲取解析 JSON 結果
一只萌萌小番薯
2024-01-18 16:52:21