Skip to content

ResponseStatus = Error for 404 (NotFound) StatusCode since v107, contrary to documentation #1747

Closed

Description

@emz00

Describe the bug
When requesting a URL that returns 404 (NotFound) RestResponse.ResponseCode is "Error" in v107, but it was "Compelted" in v106.

To Reproduce

var response = new RestClient().ExecuteGetAsync(new RestRequest("http://example.com/not-found")).GetAwaiter().GetResult();
Console.WriteLine("ResponseStatus = {0}, StatusCode = {1}", response.ResponseStatus, response.StatusCode);

Expected behavior

ResponseStatus = Completed, StatusCode = NotFound

https://restsharp.dev/error-handling.html says "If an API returns a 404, ResponseStatus will still be Completed" and this is what v106 did.

Actual behavior

ResponseStatus = Error, StatusCode = NotFound

Desktop (please complete the following information):

  • OS: Windows 7
  • .NET version: .NET Core 3.1
  • Version: 107.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions