Skip to content

Commit

Permalink
Including status code
Browse files Browse the repository at this point in the history
  • Loading branch information
wAsnk committed Jan 10, 2024
1 parent e45b4ae commit 42badeb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lombiq.HelpfulLibraries.Refit/Models/SimpleTextResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public class SimpleTextResponse
/// </summary>
public bool IsOk { get; }

/// <summary>
/// Gets the HTTP response status code.
/// </summary>
public HttpStatusCode StatusCode { get; }

/// <summary>
/// Gets the error captured by the original <see cref="ApiResponse{T}"/> or <see langword="null"/>.
/// </summary>
Expand All @@ -45,6 +50,7 @@ internal SimpleTextResponse(IApiResponse<string> response)
Content = response.Content;
Headers = response.Headers.ToDictionary(header => header.Key, header => header.Value.First());
IsOk = response.Error == null && response.StatusCode == HttpStatusCode.OK;
StatusCode = response.StatusCode;
Error = response.Error;
}

Expand Down

0 comments on commit 42badeb

Please sign in to comment.