I am testing using WebAPI 2 and I have created the following controller method.
public string Post([FromBody] string value)
{
string returnValue = "Return: " + value ;
return returnValue;
}
When I send the following message with fiddler, the method parameter returns null.
POST http://localhost:50814/api/Values/ HTTP/1.1
Host: localhost:50814
Content-Type: application/json
Content-Length: 14
{value: "New"}
I just used my code as much as I can, but still it remains zero.
I think I'm missing something very simple, but I have no ideas. Can someone please help me?
Thanks Sander
source
share