I am struggling with getting my self hosted asp.net web api server to get a call to post on a controller.
$.ajax({
url: mySelfHostedAspWebApi, //i.e. http://1.2.3.4:1234/
type: "POST",
data: cmd,
contentType: 'application/json',
success: (function(scanCmd) {
}), //success: (function (scanCmd){
});// $.ajax({
And the asp.net core controller in C# is pretty straight.
...
[Route( "" )]
[HttpPost]
public HttpResponseMessage Post(Command cmd)
{
ASSERT(null,cmd); // <=== problem here !!!
if(cmd=="go") Go(";-)");
...
In one of my old projects, I came across a similar kind of problem... And the fix was to open some file on the system, that controlled if the post was availible for myselfhostedapp and write the POST on the line that controlled the access to my application. (I just cannot recall what file it was...)
- if this sounds familiar, please add a hint.. thanks