Skip to content
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

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

Merged
merged 20 commits into from
Jul 29, 2020
Merged

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

merged 20 commits into from
Jul 29, 2020

Conversation

kjpou1
Copy link
Contributor

@kjpou1 kjpou1 commented Jul 13, 2020

Initial implementation of request options used by Browser WebAssembly.

See proposal: #34168

namespace System.Net.Http
{
    public readonly struct HttpRequestOptionsKey<TValue>
    {
        public HttpRequestOptionsKey(string key);
        public string Key { get; }
    }
    public sealed class HttpRequestOptions : IDictionary<string, object>
    {
        // Explicit interface implementation
        public bool TryGetValue<TValue>(HttpRequestOptionsKey<TValue> key, out TValue value);
        public void Set<TValue>(HttpRequestOptionsKey<TValue> key, TValue value);
    }
    public class HttpRequestMessage : IDisposable
    {
        [Obsolete("Use Options instead.")]
        public IDictionary<string, object> Properties => Options;

        public HttpRequestOptions Options { get; }
    }
}

@Dotnet-GitSync-Bot
Copy link
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
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

ghost commented Jul 13, 2020

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

@kjpou1 kjpou1 changed the title [browser][wasm] Initial addition of configuring request options [browser][wasm] Configuring request options in Browser WebAssembly Jul 13, 2020
@kjpou1 kjpou1 requested a review from marek-safar July 13, 2020 11:28
@stephentoub
Copy link
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.

@kjpou1
Copy link
Contributor Author

kjpou1 commented Jul 19, 2020

@marek-safar @stephentoub is this ready?

@stephentoub
Copy link
Member

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

Copy link
Member

@lewing lewing left a comment

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
Contributor Author

kjpou1 commented Jul 24, 2020

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

@karelz
Copy link
Member

karelz commented Jul 28, 2020

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

@karelz karelz requested a review from geoffkizer July 28, 2020 15:02
@geoffkizer
Copy link
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
Contributor Author

kjpou1 commented Jul 29, 2020

Thanks @geoffkizer

@kjpou1 kjpou1 merged commit 3eda592 into dotnet:master Jul 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
@karelz karelz 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.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to 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