I am trying to migrate an Android project to OkHttp .
What am I interested in if OkHttp compresses the body of my POST requests using gzip?
I use it like this (from an example on the home page):
RequestBody body = RequestBody.create(JSON, json); Request request = new Request.Builder() .url(url) .post(body) .build();
Will this RequestBody actually be gzip json if it is "big enough" or do I need to do it manually? As before, with AndroidHttpClient as follows:
AndroidHttpClient.getCompressedEntity(json, context.getContentResolver())
If I need to do this manually, what's the best approach?
Thanks!
source share