Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 54 forks source link

How to specify a particular named httpclient to use with the dotnetclient #296

Closed runefs closed 2 years ago

runefs commented 2 years ago

Most of our HTTP calls have a Polly policy attached to them. They are all configured as named HTTP clients however I can't see any way to specify to the client to use such an HTTP client. Is it possible to specify a named HTTP client to be used for a given client?

runefs commented 2 years ago

After investigating the code I found that it is indeed possible to provider a specific HttpClient Http. withHttpClient would be the method. So it would seem that it was merely a documentation issue.(Whether that was me not being able to find it in the documentation or the feature not being documented I don't know)

Zaid-Ajaj commented 2 years ago

Hi there @runefs sorry about the late reply! This was indeed a docs issue and I have now updated the docs and included a section about using your own HttpClient in the proxy definition

https://zaid-ajaj.github.io/Fable.Remoting/#/client-setup/dotnet#provide-an-existing-httpclient-to-make-the-requests