diff --git a/Web/API/Request.cs b/Web/API/Request.cs index f9aa5cc..05ac2f7 100644 --- a/Web/API/Request.cs +++ b/Web/API/Request.cs @@ -391,9 +391,19 @@ private async Task> Process(HttpRequestMessage request) response = await _httpClient.SendAsync(request); result.StatusCode = (int)response.StatusCode; + if ( + response.Content == null || + string.IsNullOrEmpty(await response.Content.ReadAsStringAsync()) + ) + { + result.Value = default; + + return result; + } + if (response.IsSuccessStatusCode) { - string MediaType = response.Content?.Headers?.ContentType?.MediaType.ToLower(); + string? MediaType = response.Content?.Headers?.ContentType?.MediaType.ToLower(); string ContentResponse = await response.Content?.ReadAsStringAsync(); switch (true)