How can I read the contents of a PUT request in an MVC webApi controller action.
[HttpPut] public HttpResponseMessage Put(int accountId, Contact contact) { var httpContent = Request.Content; var asyncContent = httpContent.ReadAsStringAsync().Result; ...
I get an empty string here :(
What I need to do: find out what properties were changed / sent in the initial request (this means that if the Contact object has 10 properties, and I want to update only 2 of them, I also send an object with two properties, something like this :
{ "FirstName": null, "LastName": null, "id": 21 }
Expected Outcome
List<string> modified_properties = {"FirstName", "LastName"}
c # asp.net-mvc asp.net-web-api
Marty Sep 19 2018-12-12T00: 00Z
source share