Skip to content

Use HttpClient instead of HttpWebRequest - breaking change #1406

Closed
@alexeyzimarev

Description

@alexeyzimarev

Currently, RestSharp uses HttpWebRequest, since that was the "way to do it" back in the days.

Time passed by and HttpClient dominates now, so we need to move on.

There are several issues with HttpWebRequest implementation that could be resolved by using HttpClient:

  • Use proper async flow with cancellation and context
  • Use a single instance of HttpClient for connection pooling
  • Support HTTP2

These are the main issues but there're advantages that overall come with more modern implementation.

In the latest versions of .NET framework (full and core), HttpWebRequest uses the HttpClient anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions