Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = new XMLHttpRequest();
- request.open('GET', 'https://ghibliapi.herokuapp.com/films', true);
- request.onload = function() {
- fetch('url da api', { headers:{ //seus headers } })
- .then(retorno =>{
- //faz sua tratativa do retorno aqui.
- })
- .catch(error => console.log(error))
Add Comment
Please, Sign In to add comment