This article is reprinted from the WeChat public account "UP Technology Control", the author is conan5566. Please contact the UP Technology Control public account for reprinting this article. Overview Ocelot is aimed at people running microservices/service-oriented architectures with .NET that need to have a unified entry point into their systems. In particular I wanted to easily integrate with IdentityServer references and bearer tokens. Ocelot is a bunch of middleware in a specific order. Ocelot manipulates an HttpRequest object into a state specified by its configuration until it reaches the request builder middleware where it creates an HttpRequestMessage object that is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. There is a piece of middleware that maps an HttpResponseMessage to an HttpResponse object and returns it to the client. Basically, it has a bunch of other functionality. Code Implementation 1. Create a new API client 1 2. Create a new API gateway test 3. Install Ocelot using nuget 4. Add ConfigureAppConfiguration to the Program file
5. Startup file configuration
6. Add the file ocelot.json to the gateway project
7. Run and test 2 projects Code address https://gitee.com/conanOpenSource_admin/Example/commit/b3b5a6b15a060b46c5ecd2ea31f0d36791cda18c |
<<: This year's 5G mobile phones must have these features!
>>: US operators confirm that only premium users can enjoy C-band 5G signals
Cai Yiqun told reporters that the deployment of I...
10gbiz has released a new discount plan, offering...
During the epidemic prevention and control period...
As the temperature gradually rises, this year'...
2019 can be said to be the first year of 5G base ...
DogYun is a Chinese hosting company that provides...
Aruba, a Hewlett Packard Enterprise (NYSE: HPE) c...
Driven by the Internet of Things, global manufact...
On September 6, the Ministry of Industry and Info...
With the trend of digital transformation, enterpr...
IP address and MAC address are both very importan...
Hello everyone, I am Xiaolin. A reader was asked ...
RepriseHosting recently launched a limited-editio...
Private 5G is the next evolution of networks for ...
[[398639]] This article is reprinted from the WeC...