MVC receives a message from another site - Chrome says the message has been canceled

I am sending via a plain html text file on the c:\ drive to my mvc website running on my machine:

 <body> <a id="testPost" href="./post_files/post.htm">test post</a> <script type="text/javascript"> $("#testPost").click(function () { $.post("http://hml.backend/Helix/Authorisation", { ClientIP: "192.168.20.34" }, function (resultData) { alert(resultData); }); return false; }); 

the controller is configured in this way:

 [HttpPost] public ActionResult Authorisation(string ClientIP) { string result = _videoSecurityService.CheckHelixAuthorisation(ClientIP); return Content(result); } 

The controller event gets into the debug version and there is no exception, but Chrome says

"POST: Canceled" in the debug window

Any ideas why?

+4
source share
1 answer

This is a cross-domain and is not allowed in many browsers, as this is a possible security risk. You can try to redirect your call to the server. (call your application and process the response request on another website)

+2
source

All Articles