Which method returns a promise that resolves with the result of parsing the body text as JSON?

  • .json() method
  • .text() method
  • .body() method
  • .parseJSON() method
The .json() method of a Response object returned by fetch parses the response body text as JSON and returns a Promise that resolves with the parsed data. This method is commonly used when making API requests to obtain structured data in JSON format. The .text() method returns the response body as plain text, while .body() does not exist, and .parseJSON() is not a standard method in JavaScript.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *