PUT method REST API standard - ID in Body or Uri?


In terms of standard is it necessary to add the id to the put method together with the json body item that already contains an id property eg.

public void Put(int id, [FromBody]SomeDto someDto) //someDto has Id property

The ASP.NET api template adds this and I have seen many examples of this. Is it ok to leave it out in terms of popular standards and have it like

public void Put([FromBody]SomeDto someDto).

Show source
| rest   | asp.net-web-api   | restful-architecture   | httpverbs   | put   2016-11-15 18:11 0 Answers

Answers ( 0 )

◀ Go back