0
無論是否可以接受的RESTful設計,我想給出一個結果,如下面的代碼所做的,但與200 OK
StatusCode。CreatedAtRoute(OK)(012)代碼
return CreatedAtRoute("DefaultApi", new { id = model.Id }, model);
上方的一個提供Location
頭,其利用給定id
路線變量和JSON序列model
內容。
return Ok(); // how to make it with this?
請注意,我正在使用ASP.NET WebApi2(.Net 4.6)模板。
不錯,乾淨。謝謝 – Youngjae