Copied to clipboard

Flag this post as spam?

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


  • Predrag Andrejević 10 posts 84 karma points
    Oct 16, 2019 @ 09:48
    Predrag Andrejević
    0

    Routing custom Web API endpoints

    I'm working on an Web API and need to set custom endpoints for HTTP request methods. Currently, all my endpoints are default:

    /umbraco/api/controller/method/(parameter if there's any)
    

    I've been looking for some time and found some possible solutions, but don't know how to implement them. Thus why I'm writing this post.

    Basically, I want to set them all to be in this format:

    /umbraco/api/controller/(parameter if there's any)
    

    or, if possible:

    /api/controller/(parameter it there's any)
    

    As you can see, I want the API to be able to call required method based on the type of HTTP request (without method name in the url).

    Thanks in advance!

    PS I have Content and Members that have CRUD methods, if that makes any difference.

  • Predrag Andrejević 10 posts 84 karma points
    Oct 16, 2019 @ 14:56
    Predrag Andrejević
    0

    Got it working with this solution: Solution by bronzewind

    God bless him!

Please Sign in or register to post replies

Write your reply to:

Draft