Examples of addRequestInterceptor()


Examples of com.amazonaws.http.impl.client.SdkHttpClient.addRequestInterceptor()

                        new NTCredentials(proxyUsername, proxyPassword, proxyWorkstation, proxyDomain));
            }

            // Add a request interceptor that sets up proxy authentication pre-emptively if configured
            if (config.isPreemptiveBasicProxyAuth()){
                httpClient.addRequestInterceptor(new PreemptiveProxyAuth(proxyHttpHost), 0);
            }
        }

        /* Accept Gzip response if configured */
        if (config.useGzip()) {
View Full Code Here

Examples of com.amazonaws.http.impl.client.SdkHttpClient.addRequestInterceptor()

        }

        /* Accept Gzip response if configured */
        if (config.useGzip()) {

            httpClient.addRequestInterceptor(new HttpRequestInterceptor() {

                public void process(final HttpRequest request,
                        final HttpContext context) throws HttpException,
                        IOException {
                    if (!request.containsHeader("Accept-Encoding")) {
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

   @Category(IgnoreForWildfly.class)
   public void testWrappedResponseStreamToGZip() throws Exception
   {

      DefaultHttpClient client = new DefaultHttpClient();
      client.addRequestInterceptor(new HttpRequestInterceptor()
      {

         @Override
         public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException
         {
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

        schReg.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        schReg.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
        ClientConnectionManager tsccm = new ThreadSafeClientConnManager(parameters, schReg);
       
        DefaultHttpClient defaultHttpClient = new DefaultHttpClient(tsccm, parameters);
        defaultHttpClient.addRequestInterceptor(new HttpRequestInterceptor() {
            public void process(final HttpRequest request, final HttpContext context)
                throws HttpException, IOException {
                if (!request.containsHeader("Accept-Encoding")) {
                    request.addHeader("Accept-Encoding", "gzip");
                }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

      if (genericLogin != null && !genericLogin.isEmpty()) {
        try {
          URL url = new URL(genericEntryPoint);
          Credentials credentials = new UsernamePasswordCredentials(genericLogin, genericPassword);
          cl.getCredentialsProvider().setCredentials(new AuthScope(url.getHost(), url.getPort() > 0 ? url.getPort() : 80, AuthScope.ANY_REALM), credentials);
          cl.addRequestInterceptor(new PreemptiveAuth(credentials), 0);
        } catch (MalformedURLException ex) {
          client = null;
          sessionExpirationTime = -1L;
          throw new ManifoldCFException("getClient exception: " + ex.getMessage(), ex);
        }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

    if (genericLogin != null && !genericLogin.isEmpty()) {
      try {
        URL url = new URL(genericEntryPoint);
        Credentials credentials = new UsernamePasswordCredentials(genericLogin, genericPassword);
        cl.getCredentialsProvider().setCredentials(new AuthScope(url.getHost(), url.getPort() > 0 ? url.getPort() : 80, AuthScope.ANY_REALM), credentials);
        cl.addRequestInterceptor(new PreemptiveAuth(credentials), 0);
      } catch (MalformedURLException ex) {
        throw new ManifoldCFException("getClient exception: " + ex.getMessage(), ex);
      }
    }
    HttpConnectionParams.setConnectionTimeout(cl.getParams(), connectionTimeoutMillis);
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

public class ClientGZipContentCompression {

    public final static void main(String[] args) throws Exception {
        DefaultHttpClient httpclient = new DefaultHttpClient();

        httpclient.addRequestInterceptor(new HttpRequestInterceptor() {
          
            public void process(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
                if (!request.containsHeader("Accept-Encoding")) {
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

      if (genericLogin != null && !genericLogin.isEmpty()) {
        try {
          URL url = new URL(genericEntryPoint);
          Credentials credentials = new UsernamePasswordCredentials(genericLogin, genericPassword);
          cl.getCredentialsProvider().setCredentials(new AuthScope(url.getHost(), url.getPort() > 0 ? url.getPort() : 80, AuthScope.ANY_REALM), credentials);
          cl.addRequestInterceptor(new PreemptiveAuth(credentials), 0);
        } catch (MalformedURLException ex) {
          client = null;
          sessionExpirationTime = -1L;
          throw new ManifoldCFException("getClient exception: " + ex.getMessage(), ex);
        }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

    }

    DefaultHttpClient httpClient = new DefaultHttpClient();
    String httpUrl = hiveConfMap.get(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE.varname) +
        "://" + host + ":" + port + httpPath;
    httpClient.addRequestInterceptor(
        new HttpBasicAuthInterceptor(getUserName(), getPasswd())
        );
    try {
      transport = new THttpClient(httpUrl, httpClient);
    }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()

public class ClientGZipContentCompression {

    public final static void main(String[] args) throws Exception {
        DefaultHttpClient httpclient = new DefaultHttpClient();

        httpclient.addRequestInterceptor(new HttpRequestInterceptor() {
          
            public void process(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
                if (!request.containsHeader("Accept-Encoding")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.