Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. $.ajax({
  2. url: "[url of page]",
  3. type: "POST",
  4. data: {saluto: true},
  5. dataType: 'text',
  6. success: function (response) {
  7. alert("successful" + response);
  8. },
  9. error: function () {
  10. alert("error");
  11. }
  12. });
  13.  
  14. [HttpPost("Test")]
  15. public async Task<string> testHelloWorld(bool saluto)
  16. {
  17.  
  18. try
  19. {
  20. string testString = "Funziona";
  21. Console.Write(testString + ": " + saluto + "n");
  22. return testString;
  23. }
  24. catch (Exception ex)
  25. {
  26. Log.Error("API(CallToXML) - Exception", ex);
  27. return null;
  28. }
  29. }
  30.  
  31. public async Task<string> testHelloWorld([FromBody]bool saluto)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement