Prolog
Prolog

Reputation: 3364

How to use Flurl with instance of HttpClient

Let's say I have an instance of HttpClient which is already configured. And now I want to use it for Flurl requests. I'd like to do something like this:

var poco = await httpClient.GetJsonAsync<POCO>();

Is this possible?

Upvotes: 3

Views: 2137

Answers (1)

Todd Menier
Todd Menier

Reputation: 39319

Sure...

var flurlClient = new FlurlClient(httpClient);
var poco = await flurlClient.Request(url).GetJsonAsync<POCO>();

Upvotes: 2

Related Questions