Request w JavaScript można wykonać za pomocą funkcji fetch() lub biblioteki axios. Przykład użycia fetch():
fetch('https://api.example.com/data') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
Przykład użycia axios:
axios.get('https://api.example.com/data') .then(response => console.log(response.data)) .catch(error => console.error('Error:', error));

