I have this code:
$.ajax({
type: \"POST\",
url: \"/api/slide\",
cache: false,
contentType: \"application/json; charset=u
$.ajax({
type: 'POST',
url: '/api/slide',
cache: false,
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({ title: "fghfdhgfdgfd" }),
success: function() {
...
}
});
Controller is
public class SlideController : ApiController
{
// POST /api/Slide
public void Post(string Title)
{
}
Your url is not valid, url must address the action Post in Slide controller
edit your url to url:"~/ControllerName/ActionName
" in this context must be Url:"~/Slide/Post"