Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ramon 7 posts 75 karma points
    Jun 07, 2019 @ 21:35
    Ramon
    0

    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

  • Jonathan Distenfeld 105 posts 618 karma points
    Jun 17, 2019 @ 07:07
    Jonathan Distenfeld
    0

    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

  • Ramon 7 posts 75 karma points
    Jun 25, 2019 @ 14:47
    Ramon
    0

    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.

  • 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.

Please Sign in or register to post replies