summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs
index 5bbe473e..0ecd9664 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/WebApiClient.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json;
+using StardewModdingAPI.Toolkit.Serialisation;
namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
{
@@ -18,6 +19,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
/// <summary>The API version number.</summary>
private readonly ISemanticVersion Version;
+ /// <summary>The JSON serializer settings to use.</summary>
+ private readonly JsonSerializerSettings JsonSettings = new JsonHelper().JsonSettings;
+
/*********
** Public methods
@@ -62,7 +66,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
client.Headers["Content-Type"] = "application/json";
client.Headers["User-Agent"] = $"SMAPI/{this.Version}";
string response = client.UploadString(fullUrl, data);
- return JsonConvert.DeserializeObject<TResult>(response);
+ return JsonConvert.DeserializeObject<TResult>(response, this.JsonSettings);
}
}
}