how to pass one of the incoming request header values to the downstream request path value

Ramanjaneyulu Jerugula 0 Reputation points
2023-01-24T10:40:01.3866667+00:00

how to pass one of the incoming request header values to the downstream request path value in the ocelot configuration file using .net core 6.0 & ocelot 18.0

The incoming request has header information like property ex:11313

existing downstream has path <baseurl>/API/property/<propertyid>/details

upstream path is like <baseurl>/details

x-propertyid : "121212"

I know that, what ever header value coming in request. it will be forwarded to downstream systems.

in down stream system has to read the header value.. it requries code changes in downSteam systems.

with no changes to downstream systems. using gateway has to re-map request from header value to path of request. can you please sugget any solution for this?

 {
      "DownstreamPathTemplate": "/api/property/{propertyId}/details",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "<baseurl>",
          "Port": 443
        }
      ],
      "UpstreamPathTemplate": "/propertydetails",
      "UpstreamHttpMethod": [ "GET" ],
      "Key": "getproperty"
    },
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,207 questions
0 comments No comments
{count} votes