Skip to content

Instantly share code, notes, and snippets.

@abdulhadad
Last active September 2, 2024 09:57
Show Gist options
  • Select an option

  • Save abdulhadad/a0c3d403caaa7920b353abc802678285 to your computer and use it in GitHub Desktop.

Select an option

Save abdulhadad/a0c3d403caaa7920b353abc802678285 to your computer and use it in GitHub Desktop.
github user info
// berhasil
let login = 'adobe'
fetch(`https://api.github.com/users/${login}`)
.then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));
// gagal
let login = 'asdasdasdasdasdasd'
fetch(`https://apixxxxxxx.github.com/users/${login}`)
.then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment