Skip to content

Commit

Permalink
adjust for Flurl 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lvermeulen committed Nov 2, 2020
1 parent 544aef6 commit 75c7e10
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ artifacts:
deploy:
- provider: NuGet
api_key:
secure: Uft/AgWL0ObDUb6hWLhsftRR1sNhLa5vONUcVa/2KjVAYZApxZD6ckJ+ABFQs3bB
secure: yc/gQNTv1/CbW+NYNpSF0SEOAAVVPr96aLb7kWWE764XGrDlG/ijBXyzQ+g6EnFN
skip_symbols: true
artifact: /.*\.nupkg/
on:
Expand Down
5 changes: 2 additions & 3 deletions src/Flurl.Http.Xml/CapturedXmlContent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text;
using Flurl.Http.Content;
using Flurl.Http.Content;

namespace Flurl.Http.Xml
{
Expand All @@ -14,6 +13,6 @@ public class CapturedXmlContent : CapturedStringContent
/// </summary>
/// <param name="xml">The XML.</param>
/// <param name="mediaType">The media-type.</param>
public CapturedXmlContent(string xml, string mediaType) : base(xml, Encoding.UTF8, mediaType) { }
public CapturedXmlContent(string xml, string mediaType) : base(xml, mediaType) { }
}
}
4 changes: 2 additions & 2 deletions src/Flurl.Http.Xml/Flurl.Http.Xml.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard1.4;netstandard2.0;netstandard2.1;net461;net472</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net461;net472</TargetFrameworks>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Authors>Luk Vermeulen</Authors>
Expand All @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Flurl.Http" Version="3.0.0-pre3" />
<PackageReference Include="Flurl.Http" Version="3.0.0" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/Flurl.Http.Xml/FlurlRequestExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static Task<IEnumerable<XElement>> GetXElementsFromXPath(this IFlurlReque
private static string GetMediaType(this IHttpSettingsContainer request)
{
var acceptHeaders = request.Headers
.Where(x => x.Key == "Accept")
.Where(x => x.Name == "Accept")
.ToList();

if (!acceptHeaders.Any() || acceptHeaders.All(x => x.Value == null))
Expand Down Expand Up @@ -112,11 +112,11 @@ private static string GetMediaType(this IHttpSettingsContainer request)
/// <returns>
/// A Task whose result is the received IFlurlResponse.
/// </returns>
public static async Task<IFlurlResponse> SendXmlAsync(this IFlurlRequest request, HttpMethod httpMethod, object data,
public static Task<IFlurlResponse> SendXmlAsync(this IFlurlRequest request, HttpMethod httpMethod, object data,
CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
{
var content = new CapturedXmlContent(request.Settings.XmlSerializer().Serialize(data), request.GetMediaType());
return await request.SendAsync(httpMethod, content, cancellationToken, completionOption);
return request.SendAsync(httpMethod, content, cancellationToken, completionOption);
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Flurl.Http.Xml.Tests</AssemblyName>
<PackageId>Flurl.Http.Xml.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand All @@ -12,15 +12,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.1.6" />
<PackageReference Include="coveralls.io" Version="1.4.2" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="OpenCover" Version="4.7.922" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Xunit.Extensions.Ordering" Version="1.4.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 75c7e10

Please sign in to comment.