I just create a new WebApi project and keep the default controller :
public class ValuesController : ApiController
{
// GET api/values/5
public string Get(int id)
{
return "value";
}
//other services...
}
When I try to request it, I can't get a valid JSON result.
- No specific header =>
application/xmlresult - Header with
content-typeassigned toapplication/json=>application/xmlresult - Header with
acceptassigned toapplication/jsongives me a correct responsecontent-typebut a malformed JSON :"value".
What is the way to get a valid JSON result ?