-
Expected Behavior / New FeatureIs it possible to execute some kind of class or code to do some logic to tweak an Upstream parameter so that it is different for a Downstream parameter? For example, someone consuming my API may call in to the gateway with an accountID, but my downstream path may actually need to use an accountName. The code would hook into my database service to resolve the ID to the name, and then that could be used to route for the downstream. {
"DownstreamPathTemplate": "/{accountName}/api/{everything}",
"DownstreamScheme": "http",
"ServiceName": "my-test-service",
"UpstreamPathTemplate": "/{accountID}/api/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi @DaleyKD! |
Beta Was this translation helpful? Give feedback.
-
@DaleyKD Kyle, Ocelot doesn't transforms URL placeholder values. Path Placeholder is substituted as-is. so there is no conversions.
I guess, the 2nd option is the best |
Beta Was this translation helpful? Give feedback.
@DaleyKD Kyle,
Are you still with Ocelot?
Ocelot doesn't transforms URL placeholder values. Path Placeholder is substituted as-is. so there is no conversions.
If you have a time to research Ocelot, use these features:
PreQueryStringBuilderMiddleware
of the Middleware InjectionI guess, the 2nd option is the best