Why is I getting a 404 response from my Web API controller?

Why is I getting a 404 response from my Web API controller?

I have the following action in my Web api controller: I am getting the following error with a 404 status when hitting it with either fiddler or a test jQuery script:

Can a 404 return the same URL as a post?

My gut feeling says you’re not actually POST’ing to the same URL, cause I simply can’t see how that would match a route in either MVC 5 or Core. Granted, it should probably have returned a 405 instead of 404 (this is an old bug ), but there’s definitely no combination of method and URL that matches POST /Customer/Edit/1

How to attribute routing unexpected 404 on httppost?

If you do have the default route, then the default route will match inbound, and passes the request to the one action satisfying controller=Customer, action=Edit that also accepts POST, so we run that action and serve its 302 redirection as expected.

Why do I get a 404 error for my controller?

It is not the solution for this particular post, but hopefully adding this will save someone some time trying to find the issue when they are searching for why they might be getting a 404 error for their controller. Basically, I had spelt “Controller” wrong at the end of my class name. Simple as that!

How to call a controller in MVC 4?

I have developed an MVC 4 application and used AJAX to call controller action. Locally its working fine but when I published and deployed it on local server, it gives me error and failed to call controller action from AJAX.

How to return a 404 from core MVC?

However, that does require using exceptions for program flow, which is generally a bad idea and also deprecated by the MVC Core team. Write an implementation of HttpNoContentOutputFormatter that returns 404 for GET requests. Something else I’m missing in how Core MVC is supposed to work?

Why does jQuery Ajax call give 404 resource not found?

I have a weird problem when using JQuery call in my ASP.NET MVC project. I found that the Ajax call gives 404 ( resource not found error). But when I use the usual URL GET call, I can successfully call the server without any problem. Any idea why this is so?