mirror of
https://github.com/square/okhttp.git
synced 2026-01-12 10:23:16 +03:00
On Request.Builder the one function can add the header and apply compression. Otherwise the caller needs to keep those calls in sync. One severe drawback of this approach is the calls to Request.Builder are now ordered. If you call gzip() before you call post(), it'll crash. Worse, if you call post() and then gzip() and then post() again with a different body, it'll silently not compress the new body. I don't love this drawback but I think the mitigations aren't worth the effort.