Passthrough HttpClient

RestClient is a lightweight wrapper around HttpClient - and since version 4.0 you can access the underlying HttpClient directly whenever you need it, either via the HttpClient property or by casting. You are never locked in.

var client = new RestClient("https://jsonplaceholder.typicode.com");

HttpClient httpClient = client.HttpClient;

If your client is declared as dynamic you can also cast it:

dynamic client = new RestClient("https://jsonplaceholder.typicode.com");

var httpClient = (HttpClient)client;

The HttpClient property is on IRestClient too, so a typed client can drop down to it as well.

Anything you configure via Config and the Handler Pipeline applies to the passthrough HttpClient too - you lose nothing by dropping down to the metal.

Updated: