Skip to content

Commit 5a0df71

Browse files
committed
restsharp version updated to 106.11.4
1 parent 310cc34 commit 5a0df71

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

Xero.NetStandard.OAuth2/Client/ApiClient.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private RestRequest newRequest(
345345
}
346346
else
347347
{
348-
request.AddBody(options.Data);
348+
request.AddJsonBody(options.Data);
349349
}
350350
}
351351

@@ -416,15 +416,27 @@ private async Task<ApiResponse<T>> Exec<T>(RestRequest req, IReadableConfigurati
416416
var existingDeserializer = req.JsonSerializer as IDeserializer;
417417
if (existingDeserializer != null)
418418
{
419-
client.AddHandler(existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json", "*");
419+
client.AddHandler("application/json", () => existingDeserializer);
420+
client.AddHandler("text/json", () => existingDeserializer);
421+
client.AddHandler("text/x-json", () => existingDeserializer);
422+
client.AddHandler("text/javascript", () => existingDeserializer);
423+
client.AddHandler("*+json", () => existingDeserializer);
424+
client.AddHandler("*", () => existingDeserializer);
420425
}
421426
else
422427
{
423428
var codec = new CustomJsonCodec(configuration);
424-
client.AddHandler(codec, "application/json", "text/json", "text/x-json", "text/javascript", "*+json", "*");
429+
client.AddHandler("application/json", () => codec);
430+
client.AddHandler("text/json", () => codec);
431+
client.AddHandler("text/x-json", () => codec);
432+
client.AddHandler("text/javascript", () => codec);
433+
client.AddHandler("*+json", () => codec);
434+
client.AddHandler("*", () => codec);
425435
}
426436

427-
client.AddHandler(new XmlDeserializer(), "application/xml", "text/xml", "*+xml");
437+
client.AddHandler("application/xml", () => new XmlDeserializer());
438+
client.AddHandler("text/xml", () => new XmlDeserializer());
439+
client.AddHandler("*+xml", () => new XmlDeserializer());
428440

429441
client.Timeout = configuration.Timeout;
430442

@@ -434,7 +446,7 @@ private async Task<ApiResponse<T>> Exec<T>(RestRequest req, IReadableConfigurati
434446
}
435447

436448
InterceptRequest(req);
437-
var response = await client.ExecuteTaskAsync<T>(req);
449+
var response = await client.ExecuteAsync<T>(req);
438450
InterceptResponse(req, response);
439451

440452
var result = toApiResponse(response);

Xero.NetStandard.OAuth2/Client/Configuration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Configuration : IReadableConfiguration
3131
/// Version of the package.
3232
/// </summary>
3333
/// <value>Version of the package.</value>
34-
public const string Version = "3.4.1";
34+
public const string Version = "3.5.0";
3535

3636
/// <summary>
3737
/// Identifier for ISO 8601 DateTime Format
@@ -96,7 +96,7 @@ public class Configuration : IReadableConfiguration
9696
[System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
9797
public Configuration()
9898
{
99-
UserAgent = "xero-netstandard-3.4.1";
99+
UserAgent = "xero-netstandard-3.5.0";
100100
BasePath = "https://api.xero.com/api.xro/2.0";
101101
DefaultHeader = new ConcurrentDictionary<string, string>();
102102
ApiKey = new ConcurrentDictionary<string, string>();
@@ -329,7 +329,7 @@ public static String ToDebugReport()
329329
String report = "C# SDK (Xero.NetStandard.OAuth2) Debug Report:\n";
330330
report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n";
331331
report += " Version of the API: 2.2.15\n";
332-
report += " SDK Package Version: 3.4.1\n";
332+
report += " SDK Package Version: 3.5.0\n";
333333

334334
return report;
335335
}

Xero.NetStandard.OAuth2/Xero.NetStandard.OAuth2.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Contact: api@xero.com
1010
<PropertyGroup>
1111
<TargetFramework>netstandard2.0</TargetFramework>
1212
<PackageId>Xero.NetStandard.OAuth2</PackageId>
13-
<Version>3.4.1</Version>
13+
<Version>3.5.0</Version>
1414
<Authors>Xero API</Authors>
1515
<Company>Xero</Company>
1616
<PackageLicenseUrl>https://github.com/XeroAPI/Xero-NetStandard/</PackageLicenseUrl>
@@ -25,7 +25,7 @@ Contact: api@xero.com
2525
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
2626
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
2727
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
28-
<PackageReference Include="RestSharp" Version="106.10.1" />
28+
<PackageReference Include="RestSharp" Version="106.11.4" />
2929
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
3030
</ItemGroup>
3131
</Project>

0 commit comments

Comments
 (0)