Flurl
Flurl copied to clipboard
HTTP/2 support?
Please describe the feature/enhancement in as much detail as possible. Is it possible to make it easily use http/2? I have tried the custom httpclient factory and I am still getting the same issues with only http/1.0 and http/1.1 being supported.
It would be amazing if you could set via the client object the version to use
I've got it working when I inherit winhttphandler in the custom factory.
However, to use cookies, we must use a cookiecontainer and flurl uses cookiejar. Any other options?
It's not a bad feature request - HttpRequestMessage
has a Version property but Flurl doesn't provide a way (directly or via any sort of hook) to set it. I'll add this to the backlog but it sounds like you're close to a work-around for now.
For cookies, are you saying you want to use Flurl's CookieJar? You're right that overriding CreateMessageHandler
in your factory can break that, but all you should need to do is disable the handler's cookie handling. I've never tried this with WinHttpHandler
but I'm guessing if you set CookieUsePolicy to IgnoreCookies
in your handler, that should do the trick.
Thank u bro. I just updated to .NET 6 and it seems to work without winhttphandler. But, with .NET Framework the default httpclienthandler does not seem to support http/2. Winhttphandler does though, but then its more problematic with flurl. So ill just do what everyone else is doing and move away from .NET Framework
On Friday, July 9, 2021, Todd Menier @.***> wrote:
It's not a bad feature request - HttpRequestMessage has a Version property https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httprequestmessage.version but Flurl doesn't provide a way (directly or via any sort of hook) to set it. I'll add this to the backlog but it sounds like you're close to a work-around for now.
For cookies, are you saying you want to use Flurl's CookieJar? You're right that overriding CreateMessageHandler in your factory can break that, but all you should need to do is disable the handler's cookie handling. I've never tried this with WinHttpHandler but I'm guessing if you set CookieUsePolicy https://docs.microsoft.com/en-us/dotnet/api/system.net.http.winhttphandler.cookieusepolicy to IgnoreCookies in your handler, that should do the trick.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tmenier/Flurl/issues/639#issuecomment-877286141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKIZM2NPZF624SXU7D7WQZTTW4LX5ANCNFSM5AAWE4XA .
Curious if there is any progress on this? I'm using PostJsonAsync() but getting back System.AggregateException: The response ended prematurely
. A cursory stackoverflow search suggested using HTTP2.
Good news: direct support for HTTP version will make the 4.0 cut. I think it's a good fit for Flurl's configuration pattern so it can be available at the request, client, or global level. Here's how you'll be able to set it on the client:
flurlClient.Settings.HttpVersion = "2.0";