Skip to content

Commit

Permalink
Merge pull request #632 from VincentMatthews/RestSharpv110
Browse files Browse the repository at this point in the history
Update to RestSharp v110.2.0
  • Loading branch information
abuzuhri authored Aug 9, 2023
2 parents 6e4f74d + 4f13345 commit 4809f48
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="110.2.0" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public static RestClient GetRestClient(string baseUrl)
{
BaseUrl = baseUri,
};
return new RestClient(_httpClient, restClientOption).UseNewtonsoftJson();
return new RestClient(_httpClient, restClientOption,
configureSerialization: s => s.UseNewtonsoftJson());
}
}
}
6 changes: 3 additions & 3 deletions Source/FikaAmazonAPI/FikaAmazonAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
<PackageReference Include="AWSSDK.SQS" Version="3.7.100.52" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="108.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="110.2.0" />
<PackageReference Include="StandardSocketsHttpHandler" Version="2.2.0.4" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
Expand Down
8 changes: 5 additions & 3 deletions Source/FikaAmazonAPI/Services/RequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ private void CreateRequest(string url, RestSharp.Method method)
{
if (string.IsNullOrWhiteSpace(AmazonCredential.ProxyAddress))
{
RequestClient = new RestClient(ApiBaseUrl);
var options = new RestClientOptions(ApiBaseUrl);
RequestClient = new RestClient(options,
configureSerialization: s => s.UseNewtonsoftJson());
}
else
{
Expand All @@ -70,10 +72,10 @@ private void CreateRequest(string url, RestSharp.Method method)
}
};

RequestClient = new RestClient(options);
RequestClient = new RestClient(options,
configureSerialization: s => s.UseNewtonsoftJson());
}

RequestClient.UseNewtonsoftJson();
Request = new RestRequest(url, method);
}

Expand Down

0 comments on commit 4809f48

Please sign in to comment.