Guest User

Untitled

a guest
Dec 26th, 2017
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $.ajax({
  2. url: 'http://localhost:8080/oauth/token',
  3. type: 'POST',
  4. dataType: 'json',
  5. contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
  6. beforeSend: function (xhr) {
  7. xhr.setRequestHeader('Authorization', makeBaseAuth('foo', 'bar'));
  8. },
  9. data: {
  10. grant_type: 'password',
  11. username: 'test@gmail.com',
  12. password: '1'
  13. },
  14. complete: function(result) {
  15. console.log('complete', result);
  16. },
  17.  
  18. success: function(result) {
  19. console.log('success', result);
  20. },
  21.  
  22. error: function(result) {
  23. console.log('error', result);
  24. }
  25. });
Add Comment
Please, Sign In to add comment