ajaxPost("Service1.svc/json/MyMethod", { "string" : "ana" }, bareResultWcfDate);
public Human MyMethod(string custName)
{
Human x = new Human();
x.name = custName;
return x;
}
What to put instead of the “string” in the first line?
Every example I’ve seen on the internet hasn’t got primitive types.
Basically, given the Ajax call you are making, it creates a query string
and since it is a POST request, it sends that as the body of the post request.
If it were a GET request, it would concatenate the query string to the URL like this