why the JsonServiceClient not use HttpClient? #103
-
from source code of AsyncServiceClient.I found it but it just use the extensions method (var webReq = this.CreateHttpWebRequest(requestUri)) at method SendWebRequestAsync how to control JsonServiceClient's Httpclient lifetime? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 19 replies
-
The newest C# ServiceClient that uses HttpClient you should use is the https://docs.servicestack.net/csharp-client#jsonapiclient var client = new JsonApiClient(baseUri); Which can also be registered in your App's IOC using the HttpClient factory: builder.Services.AddJsonApiClient(builder.Configuration["BaseUrl"]); Which supports both Async and Sync APIs. The older |
Beta Was this translation helpful? Give feedback.
ok I've got an updated project which you can create with:
It uses ASP.NET Core's IOC for all dependencies (inc. Services), uses Endpoint Routing and System.Text.Json by default.
I've also configured it with ASP.NET Core's Swagger UI so you can see that ServiceStack Services now integrates with other ASP.NET Core Minimal APIs, controllers etc which also use endpoint routing.
We're currently working on the docs now, but should be hopefully ready for release by next week.