* Decode response as json * * @return Promise
()
| 6158 | * @return Promise |
| 6159 | */ |
| 6160 | json() { |
| 6161 | var _this2 = this; |
| 6162 | return consumeBody.call(this).then(function(buffer) { |
| 6163 | try { |
| 6164 | return JSON.parse(buffer.toString()); |
| 6165 | } catch (err) { |
| 6166 | return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); |
| 6167 | } |
| 6168 | }); |
| 6169 | }, |
| 6170 | /** |
| 6171 | * Decode response as text |
| 6172 | * |
nothing calls this directly
no test coverage detected
searching dependent graphs…