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 HttpClientHttpClientHandler(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.
Yes, please. Enable it. It won't be breaking, because whether it's compressed is negotiated via response headers. It would be good to have in the default http client.
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 ofHttpClient
, which is sort of obnoxious.Also, the workaround of using
Request.createWithClient
with a manually constructedHttpClient
requires some knowledge of .NET's brain-damaged API. The following is not so obvious/friendly to newcomers: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 andHttpClient
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.