Replies: 2 comments 7 replies
-
Perhaps I can provide an interface in the options to use; something like this: public interface IHttpClientFactory
{
HttpClient GetHttpClient(HttpMessageHandler rootHandler);
} Internally, this will just do the obvious ( |
Beta Was this translation helpful? Give feedback.
-
@adrianhall I'm back to this now as the XF project is now MAUI, and was looking as to why we can't pass our HttpClient to the DataSync Client. It seems to make more sense as we can use the builder and extension methods for Polly / Simmy etc. I know this can be done with a DelegatingHandler but that seems a lot harder. Also when it comes to testing I would think this way would easier too ? |
Beta Was this translation helpful? Give feedback.
-
I was looking at handing network failures and adding resilience to my XF project using Polly.
I was using Polly in a MAUI project and was fairly straight forward as named
HttpClient
s can be added via theIServiceCollection
and then later used.However in the XF project we don't have this so was considering the best way to go about this. The only real solution I had come up with was to use a
DelegatingHandler
and add it to the pipeline withPolicyHttpMessageHandler
fromMicrosoft.Extensions.Http
since we can't get access the HttpClient.What do other think about this ?
Beta Was this translation helpful? Give feedback.
All reactions