添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-httpclientfactory Includes: HttpClientFactory (some bugs also in Extensions repo)
public class ValuesController : Controller
    private readonly IHttpClientFactory _httpClientFactory;
    public ValuesController(IHttpClientFactory httpClientFactory)
        _httpClientFactory = httpClientFactory;
    [HttpGet]
    public async Task<ActionResult> Get()
        var client = _httpClientFactory.CreateClient();
        client.BaseAddress = new Uri("http://api.github.com");
        string result = await client.GetStringAsync("/");
        return Ok(result);

How change HttpClientHandler after get httclient
var client = _httpClientFactory.CreateClient(); ?

maybe i can use ?

var credential = new HttpClientHandler()
                UseDefaultCredentials = true,
                Credentials = new NetworkCredential("", ""),
var client = _httpClientFactory.CreateClient(credential);
  area-networking
  Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
    and removed
  area-runtime
  labels
      Jun 2, 2023
    area-networking
  Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
    feature-httpclientfactory
  Includes: HttpClientFactory (some bugs also in Extensions repo)