(headers = {})
| 185 | } |
| 186 | |
| 187 | requestHeaders(headers = {}) { |
| 188 | const baseHeader: Record<string, string> = { |
| 189 | 'Content-Type': 'application/json; charset=utf-8', |
| 190 | ...headers, |
| 191 | }; |
| 192 | |
| 193 | if (this.token) { |
| 194 | baseHeader.Authorization = `token ${this.token}`; |
| 195 | return Promise.resolve(baseHeader); |
| 196 | } |
| 197 | |
| 198 | return Promise.resolve(baseHeader); |
| 199 | } |
| 200 | |
| 201 | async parseJsonResponse(response: Response) { |
| 202 | const json = await response.json(); |
no outgoing calls
no test coverage detected