Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save patrickbrophy/518ec42ac0462a2b8036c97e90ad049c to your computer and use it in GitHub Desktop.
Save patrickbrophy/518ec42ac0462a2b8036c97e90ad049c to your computer and use it in GitHub Desktop.
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"email": "pat1001",
"password": "password123"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://madhacksbackend.fly.dev/register", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment