I'm currently using Umbraco 7.x and trying to build out a simple API controller. I'm inheriting from UmbracoApiController and my controller is named MoviesController. I've created an action method called Index that returns a JsonResult
Not sure why the rest of my paragraph got cut off, but basically I was asking if it's possible to have a more RESTful url for API routes (e.g. GET /umbraco/api/photos, GET /umbraco/api/photos/1, PUT /umbraco/api/photos, POST /umbraco/api/photos, DELETE /umbraco/api/photos/1), rather that having to include the action in the url (e.g. GET/umbraco/api/photos/index)? I've tried using the Route attribute like MSDN demonstrates, but then I get a 404. It seems Umbraco is requiring you to have the action method in the url.
WebApi RESTful CRUD urls
I'm currently using Umbraco 7.x and trying to build out a simple API controller. I'm inheriting from UmbracoApiController and my controller is named MoviesController. I've created an action method called Index that returns a JsonResult
Hi Ramon,
I'm not sure what your question is, but have you tried reading the documentation?
Maybe this will help: https://our.umbraco.com/documentation/Reference/Routing/WebApi/
If this doesn't help, please specify your question.
~ Jonathan
Hi Jonathan,
Not sure why the rest of my paragraph got cut off, but basically I was asking if it's possible to have a more RESTful url for API routes (e.g. GET /umbraco/api/photos, GET /umbraco/api/photos/1, PUT /umbraco/api/photos, POST /umbraco/api/photos, DELETE /umbraco/api/photos/1), rather that having to include the action in the url (e.g. GET/umbraco/api/photos/index)? I've tried using the Route attribute like MSDN demonstrates, but then I get a 404. It seems Umbraco is requiring you to have the action method in the url.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.