【问题标题】:How corefx works with HttpMessageHandler?corefx 如何与 HttpMessageHandler 一起工作?
【发布时间】:2017-05-07 09:12:55
【问题描述】:

https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpMessageHandler.cs#L20

protected internal abstract Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken);

https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs#L51

Task<HttpResponseMessage> task = _handler.SendAsync(request, cancellationToken);

如何调用受保护的方法?

【问题讨论】:

    标签: .net-core


    【解决方案1】:

    不是protected。这是protected internal。这意味着“protectedinternal”。该方法可以被同一程序集中的任何代码调用。

    What is the difference between 'protected' and 'protected internal'?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-02
      • 1970-01-01
      • 2013-09-10
      • 2017-08-09
      • 2011-10-13
      • 2015-06-07
      • 2018-07-13
      • 2012-06-22
      相关资源
      最近更新 更多