Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var sJWT = KJUR.jws.JWS.sign(null, {alg: 'HS256'}, 'Maks', 'my secret is shhhhh');
- $.ajax({
- type: "POST",
- dataType: 'json',
- url: "http://192.168.2.29:3000/mapi/resources/mlogin",
- timeout: 500,
- data: {username: 'maksmaks@1337.com', password: '13371337'},
- success: function(data) {
- //show content
- console.log(data.status + " Auth");
- console.log(data.message);
- console.log('Success!')
- },
- error: function( data1 ) {
- console.log( data1.status + " Auth");
- console.log( data1.responseJSON);
- }
- });
- /*$.ajax({
- type: "POST",
- dataType: 'json',
- url: "http://192.168.2.29:3000/api/resources/report",
- data: {cause: 'Jesus', company: 'MAMK', details: 'Hail Hydra'},
- success: function(data) {
- //show content
- console.log(data.status + " Auth");
- console.log(data.message);
- console.log('Success!')
- },
- error: function( data1 ) {
- console.log( data1.status + " Auth");
- console.log( data1.responseJSON);
- }
- });
- */
- $.ajax({
- type: 'GET',
- dataType: 'json',
- url: 'http://192.168.2.29:3000/api/resources/reports/',
- //data: {username: 'maksmaks@1337.com', password: '13371337'},
- success: function(data){
- console.log(data);
- },
- error: function(data){
- console.log(data.status + " GetAllReports");
- console.log(data.message);
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement