bdparrish
bdparrish

Reputation: 2764

jQuery 'POST' being seen as 'GET' in ASP.NET Web API beta

I am sending a 'POST' request to a web API controller - "/api/customers". However, checking the request object is showing a 'GET' request instead.

$.ajax({
    url: "/api/customers",
    type: "POST",
    data: jsonSerialize,
    dataType: "jsonp"
});

Upvotes: 1

Views: 359

Answers (1)

moribvndvs
moribvndvs

Reputation: 42497

You can't perform a post when using JSONP. You have to change the type to GET, or change the dataType to something other than JSONP.

http://forum.jquery.com/topic/post-query-with-jquery-ajax-and-jsonp-datatype

Upvotes: 4

Related Questions