We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f77cac commit 9ae9a17Copy full SHA for 9ae9a17
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