You should not try to manipulate the JSON that the client sends directly. You should use the model class, as in my first comment, and allow the model binding to allow JSON into a .NET object, which can then be worked with more ease.
Assuming the client sends you JSON, which looks like this:
{givenName: "Matt", familyName: "Berry"}
You must create a .NET class to receive this request.
public class NameRequest { public string GivenName { get; set; } public string FamilyName { get; set; } }
You are now declaring an argument to your WebAPI method using the contract.
public IHttpActionResult ProcessNameRequest (NameRequest request) { request.GivenName request.FamilyName }
source share