这在Beta版本中不起作用,但在最新版本(从http://aspnetwebstack.preplex.com构建)中起作用,因此,这很可能是RC的方式。你可以做
public HttpResponseMessage Get(){ return this.Request.CreateResponse( HttpStatusCode.OK, new { Message = "Hello", Value = 123 });}
这在Beta版本中不起作用,但在最新版本(从http://aspnetwebstack.preplex.com构建)中起作用,因此,这很可能是RC的方式。你可以做
public HttpResponseMessage Get(){ return this.Request.CreateResponse( HttpStatusCode.OK, new { Message = "Hello", Value = 123 });}