asp.net webapi自定义输出结果类似Response.Write()
asp.net webapi自定义输出结果类似Response.Write()
[HttpGet] public HttpResponseMessage HelloWorld() { string result = “Hello world! Time is: ” + DateTime.Now; var resp = new HttpResponseMessage(HttpStatusCode.OK); resp.Content = new StringContent(result, System.Text.Encoding.UTF8, “text/plain”); return resp; }