Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fetch("https://just-start.eu/api/index.php", {
  2.         method: 'POST', // *GET, POST, PUT, DELETE, etc.
  3.         mode: 'no-cors', // no-cors, cors, *same-origin
  4.         cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
  5.         credentials: 'same-origin', // include, *same-origin, omit
  6.         headers: {
  7.             'Content-Type': 'application/json',
  8.             // 'Content-Type': 'application/x-www-form-urlencoded',
  9.         },
  10.         redirect: 'follow', // manual, *follow, error
  11.         referrer: 'no-referrer', // no-referrer, *client
  12.         body: JSON.stringify({request: 'registerUser', authrequired: 'false', username: gebNaam, password: wachtwoord, fullname: volNaam, email: email}) // body data type must match "Content-Type" header
  13.     })
  14.         .then((response) => {
  15.             response.json().then((data) => {
  16.                 if(data['API_code']==='003') {
  17.                     //Gebruiker is al geregistreerd!
  18.                 } else if(data['API_code']==='OK') {
  19.                     //Ga door!
  20.                 }
  21.             });
  22.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement