-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
When using the latest RestSharp version, the property IsSuccessful
of RestReponse<T>
is always false
. When using RestResponse
, IsSuccessful
is set to true
whenever the request was successful.
Expected Behavior
The value of IsSuccessful
does not depend on whether you use RestResponse<T>
or RestResponse
.
Actual Behavior
The value of IsSuccessful
does depend on whether you use RestResponse<T>
or RestResponse
.
Steps to Reproduce the Problem
Code example:
public class Program
{
class GithubRepo
{
public int Id { get; set; }
public string Name { get; set; }
}
public static async Task Main(string[] args)
{
var restClient = new RestClient("https://api.github.com/");
var request = new RestRequest("repos/RestSharp/RestSharp", Method.Get);
var response1 = await restClient.ExecuteAsync<GithubRepo>(request);
var response2 = await restClient.ExecuteAsync(request);
Console.WriteLine(response1.IsSuccessful);
Console.WriteLine(response2.IsSuccessful);
}
}
This outputs:
False
True
Using RestSharp 106, the result is
True
True
Specifications
- Version: 107.0.0.-preview.13
- Platform: .NET Core 3.1 @ Ubuntu
- Subsystem:
Metadata
Metadata
Assignees
Labels
No labels