Skip to content

What's the best way to inject custom request handling logic? #1940

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

You must be logged in to vote

@Tadimsky Hi Jonno!
Welcome to the Ocelot world! 🐯

For example, if the route was /api/posts/{postId}, we'd want to be able to access the postId parameter and lookup the location of that post and proxy the user to that location instead.

If you need a bit more functionality than simple routing like: transforms, data conversions, integrations, analysis... then our Delegating Handler feature will help you.
So, you need to develop custom delegating handler with required functionality. So, integrate your lovely Location Lookup service to a custom delegating handler.

Finally, I'd say that development of a custom middleware will be an overhead approach. So, delegating handler works fine in your…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

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
Delegating Handlers Ocelot feature: Delegating Handlers
2 participants
Converted from issue

This discussion was converted from issue #897 on January 21, 2024 11:11.