Skip to content

How to split different UpstreamHttpMethod and same UpstreamPathTemplate ? #1866

Answered by raman-m
hsmadi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @hsmadi !
You posted unexpected question! 🤣

Is that possible in the first place, and is there a way to deal with this using Ocelot, because I believe someone had this issue before.

"UpstreamPathTemplate": "/api/user/{username}",
So, different route behaviors means different routes!
You cannot merge all user scenarios into one route with one upstream template!

To solve that problem allowing different behaviors, you have to define different upstream templates.
For the 2nd scenario, Why not to specify another template like this: "UpstreamPathTemplate": "/api/user/{username}/auth", ?
That means this path requires the Admin role and given HTTP methods.

Hope it helps!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by raman-m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Initially seen a question could become a new feature or bug or closed ;)
2 participants
Converted from issue

This discussion was converted from issue #1578 on December 25, 2023 15:33.