code_junkie

How to pass multiple parameters in json format to a web service using jquery

Nov 14th, 2011
683
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. url: url,
  4. data: "{'Id1':'2'}",
  5. contentType: "application/json; charset=utf-8",
  6. dataType: "json",
  7. success: callback
  8. });
  9.  
  10. $.ajax({
  11. type: "POST",
  12. url: url,
  13. data: "{'Id1':'2'},{'Id2':'2'}",
  14. contentType: "application/json; charset=utf-8",
  15. dataType: "json",
  16. success: callback
  17. });
  18.  
  19. data: "{'Ids':[{'Id1':'2'},{'Id2':'2'}]}"
  20.  
  21. data: "{'Ids':['2','2']}"
Add Comment
Please, Sign In to add comment