Friday, 7 May 2021

javascript fetch - Failed to execute 'json' on 'Response': body stream is locked

When the request status is greater than 400(I have tried 400, 423, 429 states), fetch cannot read the returned json content. The following error is displayed in the browser console

Uncaught (in promise) TypeError: Failed to execute 'json' on 'Response': body stream is locked

I showed the contents of the returned response object as follows:

enter image description here

But I can still use it a few months ago.

My question is as follows:

  • Is this just the behavior of the Chrome browser or the fetch standard changes?
  • Is there any way to get the body content of these states?

PS: My browser version is Google Chrome 70.0.3538.102(正式版本) (64 位)



from javascript fetch - Failed to execute 'json' on 'Response': body stream is locked

No comments:

Post a Comment