All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.split.client.interceptors.GzipEncoderRequestInterceptor Maven / Gradle / Ivy

The newest version!
package io.split.client.interceptors;


import org.apache.hc.core5.http.EntityDetails;
import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpRequest;
import org.apache.hc.core5.http.HttpRequestInterceptor;
import org.apache.hc.core5.http.protocol.HttpContext;

import java.io.IOException;

/**
 * Created by adilaijaz on 5/22/15.
 */
public class GzipEncoderRequestInterceptor implements HttpRequestInterceptor {

    @Override
    public void process(HttpRequest request, EntityDetails entity, HttpContext context) throws HttpException, IOException {
        if (!request.containsHeader("Accept-Encoding")) {
            request.addHeader("Accept-Encoding", "gzip");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy