-
-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
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
Support dynamic header dictionary #1012
Merged
clairernovotny
merged 16 commits into
reactiveui:main
from
james-s-tayler:support_dynamic_header_dictionary
Dec 2, 2020
Merged
Support dynamic header dictionary #1012
clairernovotny
merged 16 commits into
reactiveui:main
from
james-s-tayler:support_dynamic_header_dictionary
Dec 2, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was
linked to
issues
Dec 2, 2020
2 tasks
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Adds a new feature to allow adding multiple dynamic headers in a single parameter by adding
[HeaderCollection] IDictionary<string, string> headers
The docs have also been update to include information on how to use the feature, as well as general advice on how to reduce boilerplate by better leveraging HttpClient middleware / DelegatingHandlers. The worked examples for adding auth headers have been reworked. A table of contents has been added to the docs. A footnote has been added about how .NET 5 changes the behavior of the
[Property]
attribute feature. A new section has been added detailing how to integratePolly.Context
with Refit.Comprehensive set of unit tests have been added for the feature also.
What is the current behavior?
Currently developers have to add multiple
[Header]
parameters creating a lot of boilerplate. There are several open tickets (#936, #884, #197) and one stale PR (#710).What might this PR break?
It's most likely to interact with all of the other support for static and dynamic headers. The code coverage is solid enough to indicate that nothing has been fundamentally broken and existing functionality has been preserved while new functionality is working as expected.
Please check if the PR fulfills these requirements
Other information:
IDictionary<string, string>
semantics were chosen specifically overIEnumerable<KeyValuePair<string, string>>
due toIDictionary
enforcing unique keys.HeaderCollection
rather than reusingHeaders
as the semantics ofHeaders
indicates it's possible to pass a string to set a key, but that simply doesn't make sense in the case of a dictionary of headers.