Core: learn it Step 8 of 16 on the Frontend Developer roadmap
Using fetch
fetch() makes HTTP requests from the browser and response.json() reads a JSON body. Check response.ok, because fetch does not throw an error on a 404 or 500.Core: learn it Step 8 of 16 on the Frontend Developer roadmap
fetch() makes HTTP requests from the browser and response.json() reads a JSON body. Check response.ok, because fetch does not throw an error on a 404 or 500.