We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 22aa4cd + 9ae9a17 commit 54874c2Copy full SHA for 54874c2
Web/API/Request.cs
@@ -391,9 +391,19 @@ private async Task<Result<T>> Process<T>(HttpRequestMessage request)
391
response = await _httpClient.SendAsync(request);
392
result.StatusCode = (int)response.StatusCode;
393
394
+ if (
395
+ response.Content == null ||
396
+ string.IsNullOrEmpty(await response.Content.ReadAsStringAsync())
397
+ )
398
+ {
399
+ result.Value = default;
400
+
401
+ return result;
402
+ }
403
404
if (response.IsSuccessStatusCode)
405
{
- string MediaType = response.Content?.Headers?.ContentType?.MediaType.ToLower();
406
+ string? MediaType = response.Content?.Headers?.ContentType?.MediaType.ToLower();
407
string ContentResponse = await response.Content?.ReadAsStringAsync();
408
409
switch (true)
0 commit comments