Hi. I wanted my fetchWithToken function to return Promise<Response> like regular fetch.
When working with fetch, I usually return response as response.json(), but request returned by configureRefreshFetch gave me an error: Failed to execute 'json' on 'Response': body stream is locked.
https://stackoverflow.com/q/53511974
This can be solved by cloning response in getResponseBody func before using text().
Hi. I wanted my
fetchWithToken
function to returnPromise<Response>
like regular fetch. When working with fetch, I usually return response asresponse.json()
, but request returned byconfigureRefreshFetch
gave me an error:Failed to execute 'json' on 'Response': body stream is locked
. https://stackoverflow.com/q/53511974This can be solved by cloning response in
getResponseBody
func before using text().