I have a controller with a method that returns some response based on the value of a parameter. I am trying to POST Json data to this controller but somehow the binding is not working. I am using Fiddler to test my controller method:
[AcceptVerbs(HttpVerbs.Post)]
public string Authenticate(string username)
{
//some logic
return "value";
}
now userName always returns null when I debug the application. To test this method I am using Fiddler. Raw data of the request is :
POST http://localsite/Home/authenticate HTTP/1.1
User-Agent: Fiddler
Host: localhost:52774
x-requested-with: XMLHttpRequest
Content-Length: 20
Content-Type: application/json; charset=utf-8
Accept: application/json
{"username":"kunal"}
Any guesses where I am going wrong in this.