Q:

HTTP Put - Pass value in URI or body?

If I want to pass two primitive types, int and bool, should I pass them in the URI like this:
[ResponseType(typeof(WriteResponse))]
[Route("Account/{clientId:int}/Client/DisableClient/{shouldDisable:bool}")]
[ResultFilter]
public IHttpActionResult PutDisableClient([FromUri]int clientId, [FromUri] bool shouldDisable)

or should I pass 1 from the body and 1 from the URI:
[ResponseType(typeof(WriteResponse))]
[Route("Account/{clientId:int}/Client/DisableClient")]
[ResultFilter]
public IHttpActionResult PutDisableClient([FromUri]int clientId, [FromBody] bool shouldDisable)

or both in the body?
What are the pros/cons for each situation?

A:

If it's a "put" then the best practise would be to pass the value in the body.
In the URI, you only pass filters values. The reason behind that is that robots that crawl your website only filter data and do not modify an entry just by crawling.

