Search code examples
asp.net.netasp.net-coreasp.net-web-apiocelot

How post json body in ocelot.json route asp.net core


{
      "DownstreamPathTemplate": "/ProceedToBuy/PostWishList",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 8003
        }
      ],
      "UpstreamPathTemplate": "/AddToWishlist",
      "UpstreamHttpMethod": [ "POST" ]
    }

I want to send json body with this route request.


Solution

  • Actually you don't have to route json the request will automatically route to the downstream path, we can just directly make request to upstream path with json and it'll work!