I'm using AttributeRouting library to make rooting easier. I've a method marked with POST attribute and gets a string parameter as below.
[POST("Create")]
public ActionResult Create(string data)
{
JavaScriptResult result = new JavaScriptResult();
User user = JsonConvert.DeserializeObject<User>(data);
BLResult bLResult = AccountingBL.CreateAccount(user);
result.Script = JsonConvert.SerializeObject(bLResult);
return result;
}
I use Fiddler to simulate post request with following headers and request body.
Headers:
User-Agent: Fiddler
Host: localhost:2253
Content-Type: application/json
Content-Length: 67
Request Body:
{"Email":"foo@foo.com","Password":"123456","Name":"Halil İbrahim"}
When i track the request, i see that data
is null. Where I miss the point?