Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. $.ajax(
  2. type: 'POST,
  3. dataType:"json",
  4. url: 'test.com'
  5. data: { mail: 'bob@test.com' }
  6. )
  7.  
  8. HttpServletRequest request;
  9. request.getParameter('mail');
  10.  
  11. fetch('test.com', {
  12. method: 'POST',
  13. headers: {
  14. 'Content-Type': 'text/plain',
  15. },
  16. body: 'mail=bob@test.com',
  17. })
  18.  
  19. fetch('test.com', {
  20. method: 'POST',
  21. headers: {
  22. 'Content-Type': 'application/json',
  23. },
  24. body: JSON.stringify({ mail: 'bob@test.com' }),
  25. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement