Skip to content

Instantly share code, notes, and snippets.

@tjmonsi
Last active January 19, 2022 10:24
Show Gist options
  • Select an option

  • Save tjmonsi/7c82bafa5fbdb8e4c6e49ebd17adec51 to your computer and use it in GitHub Desktop.

Select an option

Save tjmonsi/7c82bafa5fbdb8e4c6e49ebd17adec51 to your computer and use it in GitHub Desktop.
async handleSubmit (e) {
// after nung console.log(values)
const { username, password } = values;
// window.fetch MDN docs
const response = await fetch('http://localhost:8080/auth/login', {
method: 'POST',
headers: {
'Content-type': 'application/json'
},
body: JSON.stringify({
username: username,
password: password
})
})
const result = await response.json()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment