IHttpActionResult with JSON string
I have a method that originally returned an HttpResponseMessage and I'd like to convert this to return IHttpActionResult . My problem is the current code is using JSON.Net to serialize a complex generic tree structure, which it does well using a custom JsonConverter I wrote (the code is working fine). Here's what it returns: string json = NodeToJson(personNode); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(json, Encoding.UTF8, "application/json"); return response; The NodeToJson method is where the custom converter comes into