Advertisement
Guest User

Untitled

a guest
May 31st, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1.  
  2. $(document).ready(function() {
  3. var token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7Il9pZCI6IjU3NDZkZTdhMWQ1ZDQxM2MzYjViYTk0MCIsImZpcnN0bmFtZSI6Im1ha3MiLCJsYXN0bmFtZSI6Im1ha3MiLCJwaG9uZSI6IjEzMzcxMzM3IiwiZW1haWwiOiJtYWtzbWFrc0AxMzM3LmNvbSIsInJvbGUiOiJ1c2VyIiwiaGFzaCI6IiQyYSQxMCRkVC91bTFoTE95MnRIZUxKbjhQLnlPa0hxYU5xQS5NdXpSRnkydzRaRHQuUzhnbVJtT0FpcSJ9LCJpYXQiOjE0NjQ2OTA4NjEsImV4cCI6MTQ2NDY5ODA2MX0.sbq1mEVRpQ-mZ3PketzjLBdka1SCuxH8ijX_0HSnSZ0';
  4. //var token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7Il9pZCI6IjU3NDZkZTdhMWQ1ZDQxM2MzYjViYTk0MCIsImZpcnN0bmFtZSI6Im1ha3MiLCJsYXN0bmFtZSI6Im1ha3MiLCJwaG9uZSI6IjEzMzcxMzM3IiwiZW1haWwiOiJtYWtzbWFrc0AxMzM3LmNvbSIsInJvbGUiOiJ1c2VyIiwiaGFzaCI6IiQyYSQxMCRkVC91bTFoTE95MnRIZUxKbjhQLnlPa0hxYU5xQS5NdXpSRnkydzRaRHQuUzhnbVJtT0FpcSJ9LCJpYXQiOjE0NjQ2ODY4MTcsImV4cCI6MTQ2NDY5NDAxN30.9QSwyOj-4ZERbwGm4_fWW-ew2q0LmM2neqbaK-z2O0g';
  5. /*$.ajax({
  6. type: "POST",
  7. dataType: 'json',
  8. url: "http://192.168.2.29:3000/mapi/resources/mlogin",
  9. timeout: 500,
  10. data: {username: 'maksmaks@1337.com', password: '13371337'},
  11. success: function(data) {
  12. //show content
  13. console.log(data.status + " Auth");
  14. console.log(data.message);
  15. console.log('Success!')
  16. },
  17. error: function( data1 ) {
  18. console.log( data1.status + " Auth");
  19. console.log( data1.responseJSON);
  20.  
  21. }
  22. });
  23. */
  24.  
  25. /*$.ajax({
  26. type: "POST",
  27. dataType: 'json',
  28. url: "http://192.168.2.29:3000/api/resources/report",
  29. data: {cause: 'Jesus', company: 'MAMK', details: 'Hail Hydra'},
  30. success: function(data) {
  31. //show content
  32. console.log(data.status + " Auth");
  33. console.log(data.message);
  34. console.log('Success!')
  35. },
  36. error: function( data1 ) {
  37. console.log( data1.status + " Auth");
  38. console.log( data1.responseJSON);
  39.  
  40. }
  41. });
  42. */
  43. $.ajax({
  44. type: 'GET',
  45. dataType: 'json',
  46. url: 'http://192.168.2.29:3000/mapi/resources/reports',
  47. data: {access_token : 'sds'},
  48. success: function(data){
  49. console.log(data);
  50. console.log("Success");
  51. },
  52. error: function(data){
  53. console.log(data.status);
  54. console.log(data);
  55. }
  56. });
  57.  
  58. /*$.ajax({
  59. type: "POST",
  60. dataType: 'json',
  61. url: "http://192.168.2.29:3000/mobile/mlogin",
  62. data: {username: 'maksmaks@1337.com', password: '13371337'},
  63. success: function(data) {
  64. //show content
  65. console.log(data.token);
  66. console.log('Success!')
  67. },
  68. error: function( data1 ) {
  69. console.log( data1.status);
  70. console.log( data1.responseJSON);
  71.  
  72. }
  73. });
  74. */
  75. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement