Skip to content

[browser][wasm] Configuring request options in Browser WebAssembly - #39182

Merged
kjpou1 merged 20 commits into
dotnet:masterfrom
kjpou1:wasm-request-options
Jul 29, 2020
Merged

[browser][wasm] Configuring request options in Browser WebAssembly#39182
kjpou1 merged 20 commits into
dotnet:masterfrom
kjpou1:wasm-request-options

Conversation

@kjpou1

@kjpou1kjpou1 commented Jul 13, 2020

Copy link
Copy Markdown
Contributor

Initial implementation of request options used by Browser WebAssembly.

See proposal: #34168

namespaceSystem.Net.Http{publicreadonlystructHttpRequestOptionsKey<TValue>{publicHttpRequestOptionsKey(stringkey);publicstringKey{get;}}publicsealedclassHttpRequestOptions:IDictionary<string,object>{// Explicit interface implementationpublicboolTryGetValue<TValue>(HttpRequestOptionsKey<TValue>key,outTValuevalue);publicvoidSet<TValue>(HttpRequestOptionsKey<TValue>key,TValuevalue);}publicclassHttpRequestMessage:IDisposable{[Obsolete("Use Options instead.")]publicIDictionary<string,object>Properties=>Options;publicHttpRequestOptionsOptions{get;}}}

@Dotnet-GitSync-Bot

Copy link
Copy Markdown
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@Dotnet-GitSync-Bot

Copy link
Copy Markdown
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

@kjpou1kjpou1 changed the title [browser][wasm] Initial addition of configuring request options[browser][wasm] Configuring request options in Browser WebAssemblyJul 13, 2020
@kjpou1
kjpou1 requested a review from marek-safarJuly 13, 2020 11:28
Comment threadsrc/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs Outdated
Comment threadsrc/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs Outdated
Comment threadsrc/libraries/System.Net.Http/ref/System.Net.Http.cs Outdated
Comment threadsrc/libraries/System.Net.Http/ref/System.Net.Http.cs
@stephentoub

Copy link
Copy Markdown
Member

I started going through the PR, but it doesn't appear to match the approved API. I'll hold off reviewing further until that's resolved. Thanks.

Comment threadsrc/libraries/System.Net.Http/ref/System.Net.Http.cs Outdated
Comment threadsrc/libraries/System.Net.Http/ref/System.Net.Http.cs
Comment threadsrc/libraries/System.Net.Http/src/System/Net/Http/HttpRequestOptions.cs Outdated
Comment threadsrc/libraries/System.Net.Http/ref/System.Net.Http.cs
Comment threadsrc/libraries/System.Net.Http/src/System/Net/Http/HttpRequestOptions.cs Outdated
Comment threadsrc/libraries/System.Net.Http/src/System/Net/Http/HttpRequestOptionsKey.cs Outdated
@kjpou1

Copy link
Copy Markdown
ContributorAuthor

@marek-safar@stephentoub is this ready?

@stephentoub

Copy link
Copy Markdown
Member

@scalablecory and/or @geoffkizer, can you review while I'm out? thanks.

@lewinglewing left a comment

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.

This looks ok to me now, can we get a review from libraries/networking

@kjpou1

Copy link
Copy Markdown
ContributorAuthor

Could someone from libraries/networking give this a look over? @scalablecory and/or @geoffkizer

@karelz

Copy link
Copy Markdown
Member

@geoffkizer can you please help with code review here on behalf of ncl? Thanks!

@karelz
karelz requested a review from geoffkizerJuly 28, 2020 15:02
@geoffkizer

Copy link
Copy Markdown
Contributor

I haven't been part of the design discussions so I'm just assuming we're all happy with the design as approved -- with that said, code looks good to me.

@kjpou1

Copy link
Copy Markdown
ContributorAuthor

Thanks @geoffkizer

@kjpou1
kjpou1 merged commit 3eda592 into dotnet:masterJul 29, 2020
@kjpou1
kjpou1 deleted the wasm-request-options branch July 29, 2020 05:07
Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
…otnet#39182)
* [browser][wasm] Initial addition of configuring request options in Browser WebAssembly
* Fix key code. Not what was proposed
* Add TryGetValue<TValue> and Set<TValue> as per proposal
* Add missing obsolete attribute
* Address review comments
* Update tests to use Options and not obsolete Properties.
* Implement IDictionary<string, object?> explicitly
* Update tests to use Options and not obsolete Properties.
* Add HttpRequestOptions source to the System.Net.Http.Unit.Tests project to fix build.
* Address review comments - explicit
* Fix build error cannot convert from 'string' to 'System.Net.Http.HttpRequestOptionsKey<object>'
* Add tests for HttpRequestOptions
* Fix test build
* Add special case code for NETFRAMEWORK for API change.
* #endif out of place fix
* #endif out of place fix
@karelzkarelz added this to the 5.0.0 milestone Aug 18, 2020
zivkan added a commit to NuGet/NuGet.Client that referenced this pull request Aug 31, 2020
This dotnet/runtime PR marked Properties as obsolete:
dotnet/runtime#39182
Since we use warnings as errors, we have to change our code.
zivkan added a commit to NuGet/NuGet.Client that referenced this pull request Sep 1, 2020
This dotnet/runtime PR marked Properties as obsolete:
dotnet/runtime#39182
Since we use warnings as errors, we have to change our code.
@ghostghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@kjpou1@Dotnet-GitSync-Bot@stephentoub@karelz@geoffkizer@lewing@pranavkm@marek-safar@campersau