Skip to content

HttpClient returns a result normally, but RestSharp fails to return a result, indicating a bug in RestSharp. #2308

@colindcli

Description

@colindcli
Image
// .net framework 4.6.2
var url = "https://paldb.cc/cn/Earth_Skill_Fruit%3A_Sand_Tornado";

//use RestSharp(v112.1.0.0) to get the url
var client = new RestClient();
var request = new RestRequest(url);
var response1 = await client.ExecuteAsync(request);
var statusCode1 = response1.StatusCode;
var content1 = response1.Content;

//use HttpClient to get the same url
var response2 = await new HttpClient().GetAsync(url);
var statusCode2 = response2.StatusCode;
var content2 = await response2.Content.ReadAsStringAsync();

Test Environment:

.NET Framework version 4.6.2
RestSharp 112.1.0.0

RestSharp returned NotFound

HttpClient returned OK

Expected behavior

HttpClient returned OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-feedbackNeed feedback after the issue is fixed in preview

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions