ArpitB

Untitled

Jul 18th, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. await fetch('https://rominacsvsms.api.ushahidi.io/oauth/token', {
  2.                   method: 'POST',
  3.                   body: JSON.stringify({
  4.                     scope: '*',
  5.                     client_secret: '35e7f0bca957836d05ca0492211b0ac707671261',
  6.                     client_id: 'ushahidiui',
  7.                     grant_type: 'password',
  8.                     password: 'hellohello',
  9.                     username: '[email protected]'
  10.                   }),
  11.                   headers: {
  12.                       'Accept': 'application/json',
  13.                       'Content-Type': 'application/json',
  14.                       'Authentication': 'large-auth-string'
  15.                   }
  16.               })                                  
  17.                   .then(response => {
  18.                       return response.json();
  19.                   })
  20.                   .then(data => {
  21.                       console.log(`Success!!!`, data);
  22.                   })
  23.                   .catch(error => {
  24.                       console.log(error);
  25.                   });
Add Comment
Please, Sign In to add comment