Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Log in</title>
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  6. </head>
  7. <body>
  8.  
  9. <p id="demo">This is a paragra.</p>
  10.  
  11. <button id="but1">addShips</button>
  12. <button id="but2">log in</button>
  13. <button id="but3">getShip by id</button>
  14. <button id="del">delete</button>
  15. <button id="reg">Reg</button>
  16. <button id="confirm">confirm</button>
  17.  
  18. <script>
  19. $(document).ready(function(){
  20.     $("#but1").click(function(){
  21.         $.post("https://someleltest.herokuapp.com/api/ships",
  22.         {
  23.             "SID":"baa94319474c00240dc32f4fea7f0f513a394f6775f6e1c34765d2c51917b15a",
  24.                 "ship":{
  25.                     "location":"Earth",
  26.                     "capacity":1000,
  27.                     "volume":100321,
  28.                     "ability":"everywhere",
  29.                     "speed": 1000,
  30.                     "consumption":5
  31.  
  32.                 }
  33.             },
  34.         function(data,status){
  35.             console.log(status);
  36.                
  37.         });
  38.     });
  39.     //39f8eb913de2e5908a1fe0b3b57341e3197630e0bbdb5061be089731d99edb31
  40.     $("#but2").click(function()
  41.     {
  42.         $.post("https://someleltest.herokuapp.com/api/users",
  43.         {
  44.             "email":"r49587@mvrht.net",
  45.             "password":"test123"
  46.         },
  47.         function (data){
  48.             console.log(data);
  49.         }
  50.         )
  51.        
  52.     })
  53.  
  54.     $("#but3").click(function ()
  55.     {
  56.         $.get("https://someleltest.herokuapp.com/api/ships?SID=7852eee773a1a6a978855180a10d65908a4393908cd61c8dc3dabd660cd086f1",
  57.    
  58.             function (data,status)
  59.             {
  60.                 console.log(status);
  61.             }
  62.              )
  63.  
  64.     })
  65.     $("#del").click(function ()
  66.     {
  67.  
  68.    
  69. });
  70.     $("#reg").click(function(){
  71.         $.post("https://someleltest.herokuapp.com/api/users/register",
  72.         {
  73.             "email":"r49587@mvrht.net",
  74.             "password":"test123"
  75.         },
  76.         function(data,status){
  77.             console.log(status);
  78.         }
  79.         )
  80.     })
  81.     $("#confirm").click(function (){
  82.         $.post("https://someleltest.herokuapp.com/api/users/confirm",
  83.         {
  84.             "email":"r49587@mvrht.net",
  85.             "confirm":"30739624"
  86.         }),
  87.         function (status){
  88.             console.log(status);
  89.         }
  90.     })
  91.     $("addOperator").click(function()
  92.     {
  93.         $.post("https://someleltest.herokuapp.com/api/users/addOperator",
  94.         {
  95.             "SID":
  96.         })
  97.     })
  98.  
  99.     });
  100.  
  101. </script>
  102. </body>
  103. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement