TwitterSharp icon indicating copy to clipboard operation
TwitterSharp copied to clipboard

using IHttpClientFactory

Open benjohn88 opened this issue 3 years ago • 4 comments

Would love to know your thoughts on converting the TwitterClient to a Typed Clients with IHttpClientFactory.

eg:

services.AddHttpClient<TwitterClient >(client =>
{
   client.BaseAddress = new Uri(Configuration["BaseUrl"]);
})

Further more this would allow application using this library to inject the TwitterClient easily eg In the Application that uses this library

services.AddTwitterSharp();

This could even help to add some retry policies (if you have some plans for the same) to the httpClient Please do let me know what you think about these. Would be more than happy to work on it and raise a PR.

Thank you so much

benjohn88 avatar Apr 08 '22 10:04 benjohn88

I don't know much about services but that sounds like a nice idea, might want to also keep the old way as well tho

Xwilarg avatar Apr 08 '22 13:04 Xwilarg

@Xwilarg Awesome, would work on it then and would raise a PR for the same. Thank you

benjohn88 avatar Apr 14 '22 06:04 benjohn88

Sorry for the delay. Was busy with work . is this still up for grabs? Thanks

benjohn88 avatar Aug 11 '23 17:08 benjohn88

I'll need to speak with @marcogruhl because we don't really have an effective way to test PRs rn but yeah I think it's still free

Xwilarg avatar Aug 13 '23 08:08 Xwilarg