Compression type matching and automatic decompression
treythomas123 opened this issue · comments
Trey Thomas commented
It'd be nice to have a way to specify a compression type, for testing clients that gzip their body contents. For example:
gock.New(url).
Post("/path").
MatchCompression("gzip").
JSON(map[string]interface{}{
"foo": "bar",
}).
Reply(200)
To accomplish this now requires a custom matcher, since the JSON
matcher assumes the request body is unencoded.
I can write a PR if you're interested in including this.
Thanks!
Tom commented
That would be great! Using just Compression()
will keep it shorter but equally expressive.
Tom commented
This feature is now shipped in gock@1.0.2
. Thanks!