返回类型改为HttpResponseMessage类型
[Route("api/TestControllers/test")]
[HttpGet]
public HttpResponseMessage Test()
{
HttpResponseMessage responseMessage = new HttpResponseMessage { Content = new StringContent("你要返回的字符串", Encoding.GetEncoding("UTF-8"), "text/plain") }; return responseMessage;
}