Skip to content

Add documentation to Microsoft.Extensions.Http#57719

Merged
CarnaViire merged 12 commits intodotnet:mainfrom
resistr:issue-43916
Aug 31, 2021
Merged

Add documentation to Microsoft.Extensions.Http#57719
CarnaViire merged 12 commits intodotnet:mainfrom
resistr:issue-43916

Conversation

@resistr
Copy link
Copy Markdown
Contributor

@resistr resistr commented Aug 19, 2021

Items Addressed:

  • M:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.CreateHandlerPipeline
    (System.Net.Http.HttpMessageHandler,System.Collections.Generic.IEnumerable{System.Net.Http.DelegatingHandler})
  • M:Microsoft.Extensions.Http.IHttpMessageHandlerBuilderFilter.Configure
    (System.Action{Microsoft.Extensions.Http.HttpMessageHandlerBuilder})

Microsoft.Extensions.Http.Logging:

  • M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.#ctor(Microsoft.Extensions.Logging.ILogger)
  • M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.#ctor
    (Microsoft.Extensions.Logging.ILogger,Microsoft.Extensions.Http.HttpClientFactoryOptions)
  • M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
  • M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.#ctor(Microsoft.Extensions.Logging.ILogger)
  • M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.#ctor
    (Microsoft.Extensions.Logging.ILogger,Microsoft.Extensions.Http.HttpClientFactoryOptions)
  • M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
  • T:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler
  • T:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler

Contributes to #43916

- M:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.CreateHandlerPipeline
    (System.Net.Http.HttpMessageHandler,System.Collections.Generic.IEnumerable{System.Net.Http.DelegatingHandler})
- M:Microsoft.Extensions.Http.IHttpMessageHandlerBuilderFilter.Configure
    (System.Action{Microsoft.Extensions.Http.HttpMessageHandlerBuilder})
- M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.#ctor(Microsoft.Extensions.Logging.ILogger)
- M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.#ctor
    (Microsoft.Extensions.Logging.ILogger,Microsoft.Extensions.Http.HttpClientFactoryOptions)
- M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
- M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.#ctor(Microsoft.Extensions.Logging.ILogger)
- M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.#ctor
    (Microsoft.Extensions.Logging.ILogger,Microsoft.Extensions.Http.HttpClientFactoryOptions)
- M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
- T:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler
- T:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler

Fix dotnet#43916
@ghost ghost added area-Extensions-HttpClientFactory community-contribution Indicates that the PR has been added by a community member labels Aug 19, 2021
@ghost
Copy link
Copy Markdown

ghost commented Aug 19, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Items Addressed:

  • M:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.CreateHandlerPipeline
    (System.Net.Http.HttpMessageHandler,System.Collections.Generic.IEnumerable{System.Net.Http.DelegatingHandler})
  • M:Microsoft.Extensions.Http.IHttpMessageHandlerBuilderFilter.Configure
    (System.Action{Microsoft.Extensions.Http.HttpMessageHandlerBuilder})
  • M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.#ctor(Microsoft.Extensions.Logging.ILogger)
  • M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.#ctor
    (Microsoft.Extensions.Logging.ILogger,Microsoft.Extensions.Http.HttpClientFactoryOptions)
  • M:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
  • M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.#ctor(Microsoft.Extensions.Logging.ILogger)
  • M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.#ctor
    (Microsoft.Extensions.Logging.ILogger,Microsoft.Extensions.Http.HttpClientFactoryOptions)
  • M:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
  • T:Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler
  • T:Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler

Items not addressed:

  • Microsoft.Extensions.Http namespace
    This has to be documented directly in dotnet-api-docs.
  • M:Microsoft.Extensions.Http.HttpClientFactoryOptions.#ctor
    ctor is inferred; does not exist in code; also document directly in dotnet-api-docs? Uncertain.
  • M:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.#ctor
    ctor is inferred; does not exist in code; also document directly in dotnet-api-docs? Uncertain.
  • M:Microsoft.Extensions.Http.PolicyHttpMessageHandler.SendAsync
    (System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)
    Could not find class/method to add documentation to? Possibly removed?
  • Microsoft.Extensions.Http.Logging namespace
    This has to be documented directly in dotnet-api-docs.

Fix #43916

Author: resistr
Assignees: -
Labels:

area-Extensions-HttpClientFactory

Milestone: -

@dnfadmin
Copy link
Copy Markdown

dnfadmin commented Aug 19, 2021

CLA assistant check
All CLA requirements met.

@resistr
Copy link
Copy Markdown
Contributor Author

resistr commented Aug 19, 2021

@carlossanlop Apologies I failed to add you to this as requested.

@karelz
Copy link
Copy Markdown
Member

karelz commented Aug 19, 2021

@resistr thanks a lot for your PR!

I updated top post and changed "Fixes" to "Contributes to" as it does not address all items in the issue linked. I also deleted the list of APIs which are not covered by this PR from the top post. Hopefully I didn't mess up things.

…pMessageHandler.cs

Co-authored-by: Martin Vseticka <203266+MartyIX@users.noreply.github.com>
Copy link
Copy Markdown
Member

@CarnaViire CarnaViire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I left some comments on what I believe will be more accurate to say.

public abstract HttpMessageHandler Build();

/// <summary>
/// Creates an instance of an <see cref="HttpMessageHandler"/> using the <see cref="DelegatingHandler"/> instances
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it doesn't create a new instance, but only links existing ones, I believe it should say something like
Constructs an instance of <see cref="HttpMessageHandler"/> by chaining <paramref name="additionalHandlers"/> one after another with <paramref name="primaryHandler"/> in the end of the chain.
(let's also leave the types of params, e.g. the fact it's DelegatingHandler to <param> part of docs)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the recommended changes and thanks for the feedback.
@resistr


/// <summary>
/// Creates an instance of an <see cref="HttpMessageHandler"/> using the <see cref="DelegatingHandler"/> instances
/// provided by <paramref name="additionalHandlers"/>. The resulting pipeline can be used to manually create <see cref="HttpClient"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this method is supposed/expected to be used outside of HttpClientFactory infrastructure, especially with it being protected, so I don't think "manual creating" applies here... I'd say it's more like
The resulting pipeline is used by <see cref="IHttpClientFactory"/> infrastructure to create <see cref="HttpClient"/> instances with customized message handlers. The resulting pipeline can also be accessed by using <see cref="IHttpMessageHandlerFactory"/> instead of <see cref="IHttpClientFactory"/>.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surry for all of the noise in this section; I had borrowed the text from https://github.com/aspnet/AspNetWebStack/blob/master/src/System.Net.Http.Formatting/HttpClientFactory.cs#L58 referenced in the method.

I've made the recommended changes and thanks for the feedback.

resistr and others added 4 commits August 19, 2021 10:22
…peHttpMessageHandler.cs

Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
…Builder.cs

Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
…Builder.cs

Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
Reworded the cstor documentation on HttpMessageHandlerBuilder based on feedback from active PR.

Contributes to dotnet#43916
Copy link
Copy Markdown
Member

@CarnaViire CarnaViire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@CarnaViire
Copy link
Copy Markdown
Member

@carlossanlop adding you as a reviewer as you requested in #43916

@karelz karelz added this to the 7.0.0 milestone Aug 20, 2021
resistr and others added 6 commits August 20, 2021 05:20
…Builder.cs

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
…pMessageHandler.cs

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
…pMessageHandler.cs

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
…peHttpMessageHandler.cs

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
…peHttpMessageHandler.cs

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
Augment documentation for SendAsync in LoggingScopeHttpMessageHandler and LoggingHttpMessageHandler

Contributes to dotnet#43916
@CarnaViire
Copy link
Copy Markdown
Member

@carlossanlop could you pls check out replies to your comments and let us know your thoughts?

Copy link
Copy Markdown
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you so much for your contribution, @resistr!

@CarnaViire CarnaViire merged commit 5abee29 into dotnet:main Aug 31, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-HttpClientFactory community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants