hi
i added REST API, the Get() method working only if the Get(int id) not existing.
how can i make it to work as a regular REST service when the GET without parameters automatically give all data and when i add an id it will go to the other method?
public class RestServiceController : UmbracoApiController
{
// GET: Umbraco/api/RestService
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET: api/RestService/5
public string Get(int id)
{
return "value: " + id;
}
Umbraco API
hi i added REST API, the Get() method working only if the Get(int id) not existing.
how can i make it to work as a regular REST service when the GET without parameters automatically give all data and when i add an id it will go to the other method?
}
Hi liran,
If i'm correct you will need to use /umbraco/api/RestService/Get/5 or /umbraco/api/RestService/Get?id=5
Dave
10x
is working on a reply...