Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. $.ajax({
  2. url: 'http://7.webcinizim.com/services/user/token.json',
  3. type: 'post',
  4. dataType: 'json',
  5. success: function(token) {
  6. console.log(JSON.stringify(token));
  7. $.ajax({
  8. url: 'http://7.webcinizim.com/services/user/login.json',
  9. type: 'post',
  10. dataType: 'json',
  11. data: {
  12. username: "tolga",
  13. password: "tolga123"
  14. },
  15. success: function(user) {
  16. console.log(JSON.stringify(user));
  17. $.ajax({
  18. url: 'http://7.webcinizim.com/services/node.json',
  19. type: 'post',
  20. dataType: 'json',
  21. data: 'node[type]=page&node[title]=Hede',
  22. success: function() {
  23. console.log("Node created");
  24. },
  25. error: function(err) {
  26. console.log(err);
  27. }
  28. });
  29. });
  30. }
  31. });
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement