public class SomeService{
private IHttpClientFactory _httpFactory;
public SomeService(IHttpClientFactory httpFactory){
_httpFactory = httpFactory;
}
public void Method1(){
var client = _httpFactory.CreateClient();
//use client to do something
}
public void Method2(){
var client = _httpFactory.CreateClient();
//use client to do something
}
}
public class SomeService{
private IHttpClientFactory _httpFactory;
public SomeService(IHttpClientFactory httpFactory){
_httpFactory = httpFactory;
}
public void Method1(){
var client = _httpFactory.CreateClient();
//use client to do something
}
public void Method2(){
var client = _httpFactory.CreateClient();
//use client to do something
}
}