-
Notifications
You must be signed in to change notification settings - Fork 39
Description
I noticed that the "autoDecompress" feature from 4.x was removed in 5.x. Does this have to do with the way System.Net.Http.HttpClient handles decompression? It appears, now, that this feature must be flipped on during the initialization of HttpClient, which is sort of obnoxious.
Also, the workaround of using Request.createWithClient with a manually constructed HttpClient requires some knowledge of .NET's brain-damaged API. The following is not so obvious/friendly to newcomers:
let handler = HttpClientHandler()
handler.AutomaticDecompression <- DecompressionMethods.GZip ||| DecompressionMethods.Deflate
let client = new HttpClient(handler)
let createGzipEnabledRequest = Request.createWithClient client
Would it make sense to enable AutoDecompression for GZip and Deflate by default? This could be a potentially breaking change, but it seems like a sensible default. Otherwise, perhaps some sort of "builder" API around and HttpClient HttpClientHandler(s) would suffice.
I'd be willing to submit a PR to re-add "friendly" gzip back to the Http.fs API, but I just wanted to check with you folks first beforehand in case there's already been discussion around it.