Merge pull request #101 from tmenier/fix_encoding_win1251
fixed #86, fixed net461 dependicies, fixed tests, lowered dependicies…
This commit is contained in:
commit
d5b97ceccb
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>Flurl.Http</id>
|
||||
<version>1.0.0-beta5</version>
|
||||
<version>1.0.0-beta6-update3</version>
|
||||
<title>Flurl.Http</title>
|
||||
<authors>Todd Menier</authors>
|
||||
<projectUrl>http://tmenier.github.io/Flurl</projectUrl>
|
||||
@ -44,16 +44,23 @@
|
||||
<dependencies>
|
||||
<group targetFramework="net45">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
</group>
|
||||
<group targetFramework="net46">
|
||||
<group targetFramework="net461">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="System.Dynamic.Runtime" version="4.0.10" />
|
||||
<dependency id="System.IO.FileSystem" version="4.0.0" />
|
||||
<dependency id="System.Net.Http" version="4.0.0" />
|
||||
<dependency id="System.Runtime.Extensions" version="4.0.10" />
|
||||
<dependency id="System.Runtime.Serialization.Primitives" version="4.0.10" />
|
||||
<dependency id="System.Text.Encoding.CodePages" version="4.0.0" />
|
||||
<dependency id="System.Text.RegularExpressions" version="4.0.10" />
|
||||
<dependency id="System.Threading" version="4.0.10" />
|
||||
</group>
|
||||
<group targetFramework="monoandroid">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
|
||||
<dependency id="Microsoft.Bcl.Build" version="1.0.21" />
|
||||
<dependency id="Microsoft.Net.Http" version="2.2.29" />
|
||||
@ -61,7 +68,7 @@
|
||||
</group>
|
||||
<group targetFramework="monotouch">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
|
||||
<dependency id="Microsoft.Bcl.Build" version="1.0.21" />
|
||||
<dependency id="Microsoft.Net.Http" version="2.2.29" />
|
||||
@ -69,7 +76,7 @@
|
||||
</group>
|
||||
<group targetFramework="xamarin.ios">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
|
||||
<dependency id="Microsoft.Bcl.Build" version="1.0.21" />
|
||||
<dependency id="Microsoft.Net.Http" version="2.2.29" />
|
||||
@ -77,7 +84,7 @@
|
||||
</group>
|
||||
<group targetFramework="xamarin.mac">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
|
||||
<dependency id="Microsoft.Bcl.Build" version="1.0.21" />
|
||||
<dependency id="Microsoft.Net.Http" version="2.2.29" />
|
||||
@ -85,7 +92,7 @@
|
||||
</group>
|
||||
<group targetFramework="portable45-net45+win8+wpa81">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
|
||||
<dependency id="Microsoft.Bcl.Build" version="1.0.21" />
|
||||
<dependency id="Microsoft.Net.Http" version="2.2.29" />
|
||||
@ -93,18 +100,19 @@
|
||||
</group>
|
||||
<group targetFramework="uap10">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
</group>
|
||||
<group targetFramework="netstandard1.4">
|
||||
<dependency id="Newtonsoft.Json" version="8.0.3" />
|
||||
<dependency id="Flurl" version="2.1.0-beta5" />
|
||||
<dependency id="System.Dynamic.Runtime" version="4.0.11-rc2-24027" />
|
||||
<dependency id="System.IO.FileSystem" version="4.0.1-rc2-24027" />
|
||||
<dependency id="System.Net.Http" version="4.0.1-rc2-24027" />
|
||||
<dependency id="System.Runtime.Extensions" version="4.1.0-rc2-24027" />
|
||||
<dependency id="System.Runtime.Serialization.Primitives" version="4.1.1-rc2-24027" />
|
||||
<dependency id="System.Text.RegularExpressions" version="4.0.12-rc2-24027" />
|
||||
<dependency id="System.Threading" version="4.0.11-rc2-24027" />
|
||||
<dependency id="Flurl" version="2.1.0-beta6" />
|
||||
<dependency id="System.Dynamic.Runtime" version="4.0.10" />
|
||||
<dependency id="System.IO.FileSystem" version="4.0.0" />
|
||||
<dependency id="System.Net.Http" version="4.0.0" />
|
||||
<dependency id="System.Runtime.Extensions" version="4.0.10" />
|
||||
<dependency id="System.Runtime.Serialization.Primitives" version="4.0.10" />
|
||||
<dependency id="System.Text.Encoding.CodePages" version="4.0.0" />
|
||||
<dependency id="System.Text.RegularExpressions" version="4.0.10" />
|
||||
<dependency id="System.Threading" version="4.0.10" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>Flurl</id>
|
||||
<version>2.1.0-beta5</version>
|
||||
<version>2.1.0-beta6</version>
|
||||
<title>Flurl</title>
|
||||
<authors>Todd Menier</authors>
|
||||
<projectUrl>http://tmenier.github.io/Flurl</projectUrl>
|
||||
@ -45,9 +45,8 @@
|
||||
<group targetFramework="uap10" />
|
||||
<group targetFramework="portable40-net40+win8+wpa81" />
|
||||
<group targetFramework="netstandard1.4">
|
||||
<dependency id="System.Globalization" version= "4.0.11-rc2-24027" />
|
||||
<dependency id="System.Linq" version="4.1.0-rc2-24027" />
|
||||
<dependency id="System.Reflection.TypeExtensions" version="4.1.0-rc2-24027" />
|
||||
<dependency id="System.Linq" version="4.0.0" />
|
||||
<dependency id="System.Reflection.TypeExtensions" version="4.0.0" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
|
@ -37,11 +37,11 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Flurl, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Flurl.2.1.0-beta5\lib\portable40-net40+win8+wpa81\Flurl.dll</HintPath>
|
||||
<HintPath>..\..\packages\Flurl.2.1.0-beta6\lib\portable40-net40+win8+wpa81\Flurl.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Flurl.Http, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Flurl.Http.1.0.0-beta5\lib\portable45-net45+win8+wpa81\Flurl.Http.dll</HintPath>
|
||||
<HintPath>..\..\packages\Flurl.Http.1.0.0-beta6-update3\lib\portable45-net45+win8+wpa81\Flurl.Http.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Flurl" version="2.1.0-beta5" targetFramework="net45" />
|
||||
<package id="Flurl.Http" version="1.0.0-beta5" targetFramework="net45" />
|
||||
<package id="Flurl" version="2.1.0-beta6" targetFramework="net45" />
|
||||
<package id="Flurl.Http" version="1.0.0-beta6-update3" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
|
||||
|
@ -1,22 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
|
||||
|
@ -35,11 +35,11 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Flurl, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Flurl.2.1.0-beta5\lib\netstandard1.4\Flurl.dll</HintPath>
|
||||
<HintPath>..\..\packages\Flurl.2.1.0-beta6\lib\netstandard1.4\Flurl.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Flurl.Http, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Flurl.Http.1.0.0-beta5\lib\netstandard1.4\Flurl.Http.dll</HintPath>
|
||||
<HintPath>..\..\packages\Flurl.Http.1.0.0-beta6-update3\lib\netstandard1.4\Flurl.Http.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
@ -56,18 +56,19 @@
|
||||
<HintPath>..\..\packages\System.IO.FileSystem.Primitives.4.0.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Text.Encoding.CodePages, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Text.Encoding.CodePages.4.0.0\lib\dotnet\System.Text.Encoding.CodePages.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Net461Tester.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\PackageTester.Shared\PackageTester.Shared.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
@ -1,13 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Flurl" version="2.1.0-beta5" targetFramework="net461" />
|
||||
<package id="Flurl.Http" version="1.0.0-beta5" targetFramework="net461" />
|
||||
<package id="Flurl" version="2.1.0-beta6" targetFramework="net461" />
|
||||
<package id="Flurl.Http" version="1.0.0-beta6-update3" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net461" />
|
||||
<package id="System.Collections" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Dynamic.Runtime" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Globalization" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.IO" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.IO.FileSystem" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.IO.FileSystem.Primitives" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Net.Http" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Reflection" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Resources.ResourceManager" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Runtime" version="4.0.20" targetFramework="net461" />
|
||||
<package id="System.Runtime.Extensions" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Runtime.Handles" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Runtime.InteropServices" version="4.0.20" targetFramework="net461" />
|
||||
<package id="System.Runtime.Serialization.Primitives" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Text.Encoding" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Threading.Tasks" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Text.Encoding.CodePages" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Text.RegularExpressions" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Threading" version="4.0.10" targetFramework="net461" />
|
||||
<package id="System.Threading.Tasks" version="4.0.0" targetFramework="net461" />
|
||||
</packages>
|
@ -6,7 +6,7 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"Flurl.Http": "1.0.0-beta5"
|
||||
"Flurl.Http": "1.0.0-beta6-update3"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
|
@ -50,11 +50,11 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Flurl, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Flurl.2.1.0-beta5\lib\portable40-net40+win8+wpa81\Flurl.dll</HintPath>
|
||||
<HintPath>..\..\packages\Flurl.2.1.0-beta6\lib\portable40-net40+win8+wpa81\Flurl.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Flurl.Http, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Flurl.Http.1.0.0-beta5\lib\portable45-net45+win8+wpa81\Flurl.Http.dll</HintPath>
|
||||
<HintPath>..\..\packages\Flurl.Http.1.0.0-beta6-update3\lib\portable45-net45+win8+wpa81\Flurl.Http.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Flurl" version="2.1.0-beta5" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Flurl.Http" version="1.0.0-beta5" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Flurl" version="2.1.0-beta6" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Flurl.Http" version="1.0.0-beta6-update3" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="portable45-net45+win8+wpa81" />
|
||||
|
@ -5,8 +5,7 @@
|
||||
"compile": {
|
||||
"include": [ "../Flurl.Test.Shared/**/*.cs" ]
|
||||
},
|
||||
"emitEntryPoint": true,
|
||||
"optimize": true
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"commands": {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#if !NETCOREAPP1_0
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Flurl.Http;
|
||||
using NUnit.Framework;
|
||||
|
||||
@ -11,9 +11,9 @@ namespace Flurl.Test.Http
|
||||
[Test]
|
||||
// check that for every FlurlClient extension method, we have an equivalent Url and string extension
|
||||
public void extension_methods_consistently_supported() {
|
||||
var fcExts = ReflectionHelper.GetAllExtensionMethods<FlurlClient>(typeof(FlurlClient).Assembly);
|
||||
var urlExts = ReflectionHelper.GetAllExtensionMethods<Url>(typeof(FlurlClient).Assembly);
|
||||
var stringExts = ReflectionHelper.GetAllExtensionMethods<string>(typeof(FlurlClient).Assembly);
|
||||
var fcExts = ReflectionHelper.GetAllExtensionMethods<FlurlClient>(typeof(FlurlClient).GetTypeInfo().Assembly);
|
||||
var urlExts = ReflectionHelper.GetAllExtensionMethods<Url>(typeof(FlurlClient).GetTypeInfo().Assembly);
|
||||
var stringExts = ReflectionHelper.GetAllExtensionMethods<string>(typeof(FlurlClient).GetTypeInfo().Assembly);
|
||||
var whitelist = new[] { "GetCookies", "WithUrl" }; // cases where Url method of the same name was excluded intentionally
|
||||
|
||||
foreach (var method in fcExts) {
|
||||
@ -30,4 +30,3 @@ namespace Flurl.Test.Http
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -15,7 +15,7 @@ namespace Flurl.Test.Http
|
||||
[TestFixture]
|
||||
public class RealHttpTests
|
||||
{
|
||||
#if NET45 || NETCORE
|
||||
#if NET45 || NETCOREAPP1_0
|
||||
[Test]
|
||||
public async Task can_download_file() {
|
||||
var path = await "http://www.google.com".DownloadFileAsync(@"c:\a\b", "google.txt");
|
||||
|
@ -1,5 +1,4 @@
|
||||
#if !NETCOREAPP1_0
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
@ -12,7 +11,7 @@ namespace Flurl.Test
|
||||
// http://stackoverflow.com/a/299526/62600
|
||||
return (
|
||||
from type in asm.GetTypes()
|
||||
where type.IsSealed && !type.IsGenericType && !type.IsNested
|
||||
where type.GetTypeInfo().IsSealed && !type.GetTypeInfo().IsGenericType && !type.GetTypeInfo().IsNested
|
||||
from method in type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
|
||||
where method.IsDefined(typeof(ExtensionAttribute), false)
|
||||
where method.GetParameters()[0].ParameterType == typeof(T)
|
||||
@ -56,9 +55,9 @@ namespace Flurl.Test
|
||||
public static bool IsExtensionMethod(MethodInfo method) {
|
||||
var type = method.DeclaringType;
|
||||
return
|
||||
type.IsSealed &&
|
||||
!type.IsGenericType &&
|
||||
!type.IsNested &&
|
||||
type.GetTypeInfo().IsSealed &&
|
||||
!type.GetTypeInfo().IsGenericType &&
|
||||
!type.GetTypeInfo().IsNested &&
|
||||
method.IsStatic &&
|
||||
method.IsDefined(typeof(ExtensionAttribute), false);
|
||||
}
|
||||
@ -74,8 +73,9 @@ namespace Flurl.Test
|
||||
|
||||
public static bool AreSameType(Type a, Type b) {
|
||||
if (a.IsGenericParameter && b.IsGenericParameter) {
|
||||
var constraintsA = a.GetGenericParameterConstraints();
|
||||
var constraintsB = b.GetGenericParameterConstraints();
|
||||
|
||||
var constraintsA = a.GetTypeInfo().GetGenericParameterConstraints();
|
||||
var constraintsB = b.GetTypeInfo().GetGenericParameterConstraints();
|
||||
|
||||
if (constraintsA.Length != constraintsB.Length)
|
||||
return false;
|
||||
@ -87,7 +87,8 @@ namespace Flurl.Test
|
||||
return true;
|
||||
}
|
||||
|
||||
if (a.IsGenericType && b.IsGenericType) {
|
||||
if (a.GetTypeInfo().IsGenericType && b.GetTypeInfo().IsGenericType) {
|
||||
|
||||
if (a.GetGenericTypeDefinition() != b.GetGenericTypeDefinition())
|
||||
return false;
|
||||
|
||||
@ -109,4 +110,3 @@ namespace Flurl.Test
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -12,14 +12,12 @@ namespace Flurl.Test
|
||||
[TestFixture]
|
||||
public class UrlBuilderTests
|
||||
{
|
||||
|
||||
#if !NETCOREAPP1_0
|
||||
[Test]
|
||||
// check that for every Url method, we have an equivalent string extension
|
||||
public void extension_methods_consistently_supported()
|
||||
{
|
||||
var urlMethods = typeof(Url).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(m => !m.IsSpecialName);
|
||||
var stringExts = ReflectionHelper.GetAllExtensionMethods<string>(typeof(Url).Assembly);
|
||||
var stringExts = ReflectionHelper.GetAllExtensionMethods<string>(typeof(Url).GetTypeInfo().Assembly);
|
||||
var whitelist = new[] { "ToString", "IsValid" }; // cases where string extension of the same name was excluded intentionally
|
||||
|
||||
foreach (var method in urlMethods)
|
||||
@ -33,7 +31,6 @@ namespace Flurl.Test
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void Path_returns_everything_but_querystring()
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"title": "Flurl.Http",
|
||||
"version": "1.0.0-beta5",
|
||||
"version": "1.0.0-beta6-update3",
|
||||
|
||||
"dependencies": {
|
||||
"Flurl": "2.1.0-beta5",
|
||||
"Flurl": "2.1.0-beta6",
|
||||
"Newtonsoft.Json": "8.0.3"
|
||||
},
|
||||
|
||||
@ -40,13 +40,14 @@
|
||||
"netstandard1.4": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"System.Dynamic.Runtime": "4.0.11-rc2-24027",
|
||||
"System.IO.FileSystem": "4.0.1-rc2-24027",
|
||||
"System.Net.Http": "4.0.1-rc2-24027",
|
||||
"System.Runtime.Extensions": "4.1.0-rc2-24027",
|
||||
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24027",
|
||||
"System.Text.RegularExpressions": "4.0.12-rc2-24027",
|
||||
"System.Threading": "4.0.11-rc2-24027"
|
||||
"System.Dynamic.Runtime": "4.0.10",
|
||||
"System.IO.FileSystem": "4.0.0",
|
||||
"System.Net.Http": "4.0.0",
|
||||
"System.Runtime.Extensions": "4.0.10",
|
||||
"System.Runtime.Serialization.Primitives": "4.0.10",
|
||||
"System.Text.Encoding.CodePages": "4.0.0",
|
||||
"System.Text.RegularExpressions": "4.0.10",
|
||||
"System.Threading": "4.0.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
#if NETSTANDARD1_4
|
||||
using System.Text;
|
||||
#endif
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Flurl.Http
|
||||
@ -18,6 +21,7 @@ namespace Flurl.Http
|
||||
/// <typeparam name="T">A type whose structure matches the expected JSON response.</typeparam>
|
||||
/// <returns>A Task whose result is an object containing data in the response body.</returns>
|
||||
/// <example>x = await url.PostAsync(data).ReceiveJson<T>()</example>
|
||||
/// <exception cref="FlurlHttpException">Condition.</exception>
|
||||
public static async Task<T> ReceiveJson<T>(this Task<HttpResponseMessage> response) {
|
||||
var resp = await response.ConfigureAwait(false);
|
||||
var call = HttpCall.Get(resp.RequestMessage);
|
||||
@ -27,7 +31,7 @@ namespace Flurl.Http
|
||||
}
|
||||
catch (Exception ex) {
|
||||
call.Exception = ex;
|
||||
throw new FlurlHttpException(call);
|
||||
throw new FlurlHttpException(call, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,6 +40,7 @@ namespace Flurl.Http
|
||||
/// </summary>
|
||||
/// <returns>A Task whose result is a dynamic object containing data in the response body.</returns>
|
||||
/// <example>d = await url.PostAsync(data).ReceiveJson()</example>
|
||||
/// <exception cref="FlurlHttpException">Condition.</exception>
|
||||
public static async Task<dynamic> ReceiveJson(this Task<HttpResponseMessage> response) {
|
||||
return await response.ReceiveJson<ExpandoObject>().ConfigureAwait(false);
|
||||
}
|
||||
@ -45,6 +50,7 @@ namespace Flurl.Http
|
||||
/// </summary>
|
||||
/// <returns>A Task whose result is a list of dynamic objects containing data in the response body.</returns>
|
||||
/// <example>d = await url.PostAsync(data).ReceiveJsonList()</example>
|
||||
/// <exception cref="FlurlHttpException">Condition.</exception>
|
||||
public static async Task<IList<dynamic>> ReceiveJsonList(this Task<HttpResponseMessage> response) {
|
||||
dynamic[] d = await response.ReceiveJson<ExpandoObject[]>().ConfigureAwait(false);
|
||||
return d;
|
||||
@ -56,6 +62,9 @@ namespace Flurl.Http
|
||||
/// <returns>A Task whose result is the response body as a string.</returns>
|
||||
/// <example>s = await url.PostAsync(data).ReceiveString()</example>
|
||||
public static async Task<string> ReceiveString(this Task<HttpResponseMessage> response) {
|
||||
#if NETSTANDARD1_4
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
#endif
|
||||
return await (await response.ConfigureAwait(false)).Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"title": "Flurl",
|
||||
"version": "2.1.0-beta5",
|
||||
"version": "2.1.0-beta6",
|
||||
|
||||
"buildOptions": {
|
||||
"compile": {
|
||||
@ -20,10 +20,10 @@
|
||||
}
|
||||
},
|
||||
"netstandard1.4": {
|
||||
"imports": "dotnet",
|
||||
"dependencies": {
|
||||
"System.Globalization": "4.0.11-rc2-24027",
|
||||
"System.Linq": "4.1.0-rc2-24027",
|
||||
"System.Reflection.TypeExtensions": "4.1.0-rc2-24027"
|
||||
"System.Linq": "4.0.0",
|
||||
"System.Reflection.TypeExtensions": "4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user