fetch(url, { //Metodos method: 'POST', // GET, POST, PUT, DELETE //Cuerpo body: JSON.stringify(data), headers:{ 'Content-Type': 'application/json' } }).then(res => res.json()) .catch(error => console.error('Error:', error)) .then(response => console.log('Success:', response));