Code Snippets
Free, reusable code snippets for developers. Save time with ready-to-use solutions.
1 snippets found
JavaScript
JavaScript Fetch API
Modern way to make HTTP requests
// GET request
fetch("https://api.example.com/data")
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
// POST request
fetch("...
Code copied to clipboard!