develop
bicijinlian 6 years ago
parent 8ce3e1acdf
commit f4f3aeb13d

@ -18,15 +18,23 @@ namespace xUnitStudy.WebApi.Controllers
return new string[] { "value1", "value2" };
}
// GET api/values/5
[System.Web.Http.Authorize]
public string Get(int id)
{
return id.ToString();
}
// POST api/values
public void Post([FromBody]string value)
public IHttpActionResult Post([FromBody]string value)
{
var cc = new System.Web.Http.Results.CreatedAtRouteNegotiatedContentResult<string>
(
"",
new Dictionary<string, object> { { "id",2} },
"",
this
);
return cc;
}
// PUT api/values/5

Loading…
Cancel
Save