diff options
author | Egor Bogatov <egorbo@gmail.com> | 2019-03-06 10:55:16 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2019-03-06 10:55:16 +0300 |
commit | e42bf95d14b7ea16abcdff99d769e9f250ec2fd0 (patch) | |
tree | e98658bd49b77b58df3c021199fa2ffa9ca8b228 /mcs/class/System.Net.Http | |
parent | b31a445e85523a9a41b0975203f7ccd1d6f185a8 (diff) |
NS2.1 Sync new changes, mobile profiles (#13198)
* Add RuntimeHelpers.GetSubArray. Add missing types to NS's TypeForwarders.cs
* more NS2.1 changes
* ios changes
* Update Decimal (it's now readonly struct)
* fix mcs
* add ROMC.cs
* Fix tests, finish monodroid profile
* Make SRE-not-supported NS2.1 compatible
* Make monotouch_tv and watch NS2.1 compatible
* make some SRE types more NS21 compatible (non-abstract now)
* bump corefx
* More NS21 fixes
* bump coreclr acceptance tests
* Bump API snapshot submodule
* [csproj] Update project files
Diffstat (limited to 'mcs/class/System.Net.Http')
8 files changed, 41 insertions, 0 deletions
diff --git a/mcs/class/System.Net.Http/HttpClientHandler.Legacy.cs b/mcs/class/System.Net.Http/HttpClientHandler.Legacy.cs index 97904594ca3..d4e64ddda11 100644 --- a/mcs/class/System.Net.Http/HttpClientHandler.Legacy.cs +++ b/mcs/class/System.Net.Http/HttpClientHandler.Legacy.cs @@ -7,5 +7,8 @@ namespace System.Net.Http partial class HttpClientHandler : HttpMessageHandler { static IMonoHttpClientHandler CreateDefaultHandler () => new MonoWebRequestHandler (); + + // NS2.1: + public static System.Func<System.Net.Http.HttpRequestMessage, System.Security.Cryptography.X509Certificates.X509Certificate2, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator => throw new PlatformNotSupportedException (); } } diff --git a/mcs/class/System.Net.Http/System.Net.Http.csproj b/mcs/class/System.Net.Http/System.Net.Http.csproj index 9d626433300..c19ddfb4b38 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.csproj +++ b/mcs/class/System.Net.Http/System.Net.Http.csproj @@ -178,6 +178,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'winaot'"> @@ -240,6 +241,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'wasm'"> @@ -303,6 +305,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'unreal'"> @@ -365,6 +368,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'orbis'"> @@ -427,6 +431,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'net_4_x'"> @@ -492,6 +497,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(HostPlatform)' == 'unix'"> @@ -900,6 +906,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'monotouch_tv'"> @@ -967,6 +974,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'monotouch'"> @@ -1034,6 +1042,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> <When Condition="'$(Platform)' == 'monodroid'"> @@ -1097,6 +1106,7 @@ <Compile Include="System.Net.Http\MultipartFormDataContent.cs" /> <Compile Include="System.Net.Http\StreamContent.cs" /> <Compile Include="System.Net.Http\StringContent.cs" /> + <Compile Include="corefx\ReadOnlyMemoryContent.cs" /> </ItemGroup> </When> </Choose> diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.android.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.android.cs index f48b49cd104..be3b46db0c5 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.android.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.android.cs @@ -1,5 +1,7 @@ using System; using System.Reflection; +using System.Threading; +using System.Threading.Tasks; namespace System.Net.Http { public partial class HttpClient { diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs index a4cb8ac68f2..4ac94fa839c 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs @@ -335,5 +335,11 @@ namespace System.Net.Http return await resp.Content.ReadAsStringAsync ().ConfigureAwait (false); } } + + // NS2.1 methods, added here while CoreFX HttpClient PR is not merged + public Task<HttpResponseMessage> PatchAsync(string requestUri, HttpContent content) => throw new PlatformNotSupportedException(); + public Task<HttpResponseMessage> PatchAsync(string requestUri, HttpContent content, CancellationToken cancellationToken) => throw new PlatformNotSupportedException(); + public Task<HttpResponseMessage> PatchAsync(Uri requestUri, HttpContent content) => throw new PlatformNotSupportedException(); + public Task<HttpResponseMessage> PatchAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken) => throw new PlatformNotSupportedException(); } } diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs index f796a202d54..05935885325 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs @@ -169,5 +169,8 @@ namespace System.Net.Http get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + + // NS2.1: + public static System.Func<System.Net.Http.HttpRequestMessage, System.Security.Cryptography.X509Certificates.X509Certificate2, System.Security.Cryptography.X509Certificates.X509Chain, System.Net.Security.SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator => throw new PlatformNotSupportedException (); } } diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpMethod.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpMethod.cs index a88b78464b0..58754499129 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpMethod.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpMethod.cs @@ -131,5 +131,8 @@ namespace System.Net.Http { return method; } + + // NS2.1: + public static System.Net.Http.HttpMethod Patch => throw new PlatformNotSupportedException (); } } diff --git a/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs b/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs new file mode 100644 index 00000000000..f4272bfb550 --- /dev/null +++ b/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Net.Http +{ + public sealed partial class ReadOnlyMemoryContent : System.Net.Http.HttpContent + { + public ReadOnlyMemoryContent(System.ReadOnlyMemory<byte> content) => throw new PlatformNotSupportedException(); + protected internal override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) => throw new PlatformNotSupportedException(); + protected internal override bool TryComputeLength(out long length) => throw new PlatformNotSupportedException(); + } +}
\ No newline at end of file diff --git a/mcs/class/System.Net.Http/legacy.sources b/mcs/class/System.Net.Http/legacy.sources index 4a200fd6e6b..1a5047bda62 100644 --- a/mcs/class/System.Net.Http/legacy.sources +++ b/mcs/class/System.Net.Http/legacy.sources @@ -22,6 +22,7 @@ System.Net.Http/MultipartContent.cs System.Net.Http/MultipartFormDataContent.cs System.Net.Http/StreamContent.cs System.Net.Http/StringContent.cs +corefx/ReadOnlyMemoryContent.cs System.Net.Http.Headers/AuthenticationHeaderValue.cs System.Net.Http.Headers/CacheControlHeaderValue.cs System.Net.Http.Headers/CollectionExtensions.cs |