webapi2 return simple string without quotation mark
问题 Simple scenario: public IHttpActionResult Get() { return Ok<string>("I am send by HTTP resonse"); } returns: "I am send by HTTP resonse" Just curious, can I avoid the quotation mark in other words return: I am send by HTTP resonse or is this necessary in HTTP? 回答1: Yes you can avoid the " public class ValuesController : ApiController { public string Get() { return "qwerty"; } } now check http://localhost:3848/api/values and response <string xmlns="http://schemas.microsoft.com/2003/10