Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use of .json() in javascript

fetch('http://example.com/movies.json')
  .then(response => response.json())
  .then(data => console.log(data));
//Since the HTTP response is not a JSON Object, 
//.json() extracts the JSON Object from the HTTP response
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
1+2 =