Does RESTful design prefer data in the URL or [FromBody]?
Suppose I have a controller method:
[Route("ServiceActivity({serviceActivityGuid:guid})/State({serviceAppointmentState:int})/Status({statusCode:int})", Name = "ServiceActivityStateStatusPut")]
[HttpPut]
[NotNull]
public ServiceAppointment ServiceActivityStateStatusPut(int serviceAppointmentState, int statusCode, Guid serviceActivityGuid)
{
return this.serviceActivityService.UpdateShowTimeAs(serviceAppointmentState, statusCode, serviceActivityGuid);
}
Would it be preferable to do something like this instead?
[Route("ServiceActivity({serviceActivityGuid:guid})", Name = "ServiceActivityStateStatusPut")]
[HttpPut]
[NotNull]
public ServiceAppointment ServiceActivityStateStatusPut([FromBody] myObject)
{
return this.serviceActivityService.UpdateShowTimeAs(myObject);
}
The behavior of this should be that when client navigates to:
../ServiceActivity({serviceActivityGuid:guid})/State({serviceAppointmentState:int})/Status({statusCode:int})
specifically:
../ServiceActivity(BF6ACF8D-8967-4D2B-BF53-E112D15A609B)/State(1)/Status(0)
Then it should set the the State to 1 and the Status to 0 for the record with primary key BF6ACF8D-8967-4D2B-BF53-E112D15A609B.
Does RESTful design prefer data in the URL or [FromBody]?