Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch("https://just-start.eu/api/index.php", {
- method: 'POST', // *GET, POST, PUT, DELETE, etc.
- mode: 'no-cors', // no-cors, cors, *same-origin
- cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
- credentials: 'same-origin', // include, *same-origin, omit
- headers: {
- 'Content-Type': 'application/json',
- // 'Content-Type': 'application/x-www-form-urlencoded',
- },
- redirect: 'follow', // manual, *follow, error
- referrer: 'no-referrer', // no-referrer, *client
- body: JSON.stringify({request: 'registerUser', authrequired: 'false', username: gebNaam, password: wachtwoord, fullname: volNaam, email: email}) // body data type must match "Content-Type" header
- })
- .then((response) => {
- response.json().then((data) => {
- if(data['API_code']==='003') {
- //Gebruiker is al geregistreerd!
- } else if(data['API_code']==='OK') {
- //Ga door!
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement