WebApi的IhttpActionresult和HttpResponseMessage的用法

[HttpGet]
[HttpPost]
public IHttpActionResult getModel([FromBody] Student Test )
{

Test.Name = Test.Name + "webapi";
return Json<Student>(Test);
}
[HttpGet]
[HttpPost]
public HttpResponseMessage getModel1()
{

return new HttpResponseMessage { Content = new StringContent("123")};
}

posted @ 2018-01-11 17:50  yrz_hello1  阅读(283)  评论(0编辑  收藏  举报