diff --git a/src/Tgstation.Server.Api/ApiHeaders.cs b/src/Tgstation.Server.Api/ApiHeaders.cs
index 349522be7f..0ad8c7a487 100644
--- a/src/Tgstation.Server.Api/ApiHeaders.cs
+++ b/src/Tgstation.Server.Api/ApiHeaders.cs
@@ -50,6 +50,11 @@ namespace Tgstation.Server.Api
///
public const string OAuthAuthenticationScheme = "OAuth";
+ ///
+ /// Added to in netstandard2.1. Can't use because of Tgstation.Server.Migrator.
+ ///
+ public const string ApplicationJsonMime = "application/json";
+
///
/// Get the version of the the caller is using.
///
@@ -167,9 +172,9 @@ namespace Tgstation.Server.Api
errorBuilder.Append(message);
}
- var jsonAccept = new Microsoft.Net.Http.Headers.MediaTypeHeaderValue(MediaTypeNames.Application.Json);
+ var jsonAccept = new Microsoft.Net.Http.Headers.MediaTypeHeaderValue(ApplicationJsonMime);
if (!requestHeaders.Accept.Any(x => jsonAccept.IsSubsetOf(x)))
- AddError(HeaderTypes.Accept, $"Client does not accept {MediaTypeNames.Application.Json}!");
+ AddError(HeaderTypes.Accept, $"Client does not accept {ApplicationJsonMime}!");
if (!requestHeaders.Headers.TryGetValue(HeaderNames.UserAgent, out var userAgentValues) || userAgentValues.Count == 0)
AddError(HeaderTypes.UserAgent, $"Missing {HeaderNames.UserAgent} header!");
@@ -306,7 +311,7 @@ namespace Tgstation.Server.Api
throw new InvalidOperationException("Specified different instance IDs in constructor and SetRequestHeaders!");
headers.Clear();
- headers.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json));
+ headers.Accept.Add(new MediaTypeWithQualityHeaderValue(ApplicationJsonMime));
headers.UserAgent.Add(new ProductInfoHeaderValue(UserAgent));
headers.Add(ApiVersionHeader, new ProductHeaderValue(AssemblyName.Name, ApiVersion.ToString()).ToString());
if (OAuthProvider.HasValue)
diff --git a/src/Tgstation.Server.Client/ApiClient.cs b/src/Tgstation.Server.Client/ApiClient.cs
index fac48c439a..36344c265f 100644
--- a/src/Tgstation.Server.Client/ApiClient.cs
+++ b/src/Tgstation.Server.Client/ApiClient.cs
@@ -26,6 +26,12 @@ namespace Tgstation.Server.Client
///
sealed class ApiClient : IApiClient
{
+ ///
+ /// PATCH .
+ ///
+ /// HOW IS THIS NOT INCLUDED IN THE FRAMEWORK??!?!?
+ static readonly HttpMethod HttpPatch = new ("PATCH");
+
///
public Uri Url { get; }
@@ -77,7 +83,7 @@ namespace Tgstation.Server.Client
/// Get the to use.
///
/// A new instance.
- static JsonSerializerSettings GetSerializerSettings() => new JsonSerializerSettings
+ static JsonSerializerSettings GetSerializerSettings() => new ()
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
Converters = new[] { new VersionConverter() },
@@ -171,7 +177,7 @@ namespace Tgstation.Server.Client
public Task Update(string route, TBody body, CancellationToken cancellationToken) where TBody : class => RunRequest(route, body, HttpMethod.Post, null, false, cancellationToken);
///
- public Task Patch(string route, CancellationToken cancellationToken) => RunRequest