Closed Moulick closed 2 months ago
@Moulick In case you still have this problem, take a look at https://github.com/gin-contrib/gzip.
Thanks @dstracab. Checking back on my code now, it looks like I wrote my own? https://github.com/Moulick/kinesis2elastic/blob/main/gzipbinding/binding.go. Been a few years so I can't remember why I did not use https://github.com/gin-contrib/gzip but there must have been some reason. I think in my case the request could come both ways, as gzip or as direct json so I also had to write some detection. ¯\_(ツ)_/¯
Description
I want to write an api that will be sent gzipped json data with POST. While the below can deal with simple json in the body, it does not deal if the json is gzipped. Do we need to explicitly handle the decompression before using
c.ShouldBindJSON
?How to reproduce
Expectations
Actual result
Environment
go version go1.17.2 darwin/amd64
v1.7.4