The Content-Length header is included when using PostAsync and compression is possible.
With the addition of a compression option and the use of the Content-Length header to RequestAsync I would be able to handle Http calls more efficiently by using the dictionary response which is not included in PostAsync.
This would also potentially lead to the deprecation of RequestAsync/GetAsync as RequestAsync would then be capable of the same functionality.
Other Roblox-Id header is not documented and can this be removed as it is not required.
So you want to be able to compress request bodies? We would probably implement this as a Compression = “gzip” option and then handle it for you automatically so you wouldn’t have to do it in Lua because that is slow.
My current use case is for game analytics which supports a request body of up to 1mb. Being able to compress this amount data would help a lot.
It would not be practical for me to develop a gzip module as it would also require me to develop a deflate compression module which in turn uses LZ77 and Huffman coding. As you said it would be slow to implement this in Lua and the lack of bit operations do not help.
Implementing this as a option for RequestAsync would definitely help.
I am sending huge data to my servers and RequestAsync not having compression is really upsetting to me. PostAsync is extremely ugly and should be deprecated, but RequestAsync doesn’t seem to support compression?