(headers = {})
| 159 | } |
| 160 | |
| 161 | requestHeaders(headers = {}) { |
| 162 | const baseHeader: Record<string, string> = { |
| 163 | 'Content-Type': 'application/json; charset=utf-8', |
| 164 | ...headers, |
| 165 | }; |
| 166 | |
| 167 | if (this.token) { |
| 168 | baseHeader.Authorization = `token ${this.token}`; |
| 169 | return Promise.resolve(baseHeader); |
| 170 | } |
| 171 | |
| 172 | return Promise.resolve(baseHeader); |
| 173 | } |
| 174 | |
| 175 | async parseJsonResponse(response: Response) { |
| 176 | const json = await response.json(); |
no outgoing calls
no test coverage detected