diff --git a/xUnitStudy.WebApi/Controllers/ValuesController.cs b/xUnitStudy.WebApi/Controllers/ValuesController.cs index be52895..118366c 100644 --- a/xUnitStudy.WebApi/Controllers/ValuesController.cs +++ b/xUnitStudy.WebApi/Controllers/ValuesController.cs @@ -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 + ( + "", + new Dictionary { { "id",2} }, + "", + this + ); + return cc; } // PUT api/values/5