Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.DefaultHttpClient


    tokenRequest.setEntity(new ByteArrayEntity(postBody.getBytes()));
    tokenRequest.addHeader("Authorization", AuthorizationCodeTestIT.authorizationBasic(clientId, secret));
    tokenRequest.addHeader("Content-Type", "application/x-www-form-urlencoded");

    HttpResponse tokenHttpResponse = new DefaultHttpClient().execute(tokenRequest);
    final InputStream responseContent = tokenHttpResponse.getEntity().getContent();
    String responseAsString = new Scanner(responseContent).useDelimiter("\\A").next();
    responseContent.close();
    tokenResponse = responseAsString;
  }
View Full Code Here


    WebTarget target = client.target( serverUri + "/_config/admins/" + serverAdminUser );
    target.request().delete().close();
  }

  private static ResteasyClient getClientWithServerAdminCredentials() {
    DefaultHttpClient httpClient = new DefaultHttpClient();

    httpClient.getCredentialsProvider().setCredentials(
        new AuthScope( host, port ),
        new UsernamePasswordCredentials( serverAdminUser, serverAdminPassword )
        );

    AuthCache authCache = new BasicAuthCache();
View Full Code Here

    tokenRequest.setEntity(new ByteArrayEntity(postBody.getBytes()));
    tokenRequest.addHeader("Authorization", authorizationBasic(username, password));
    tokenRequest.addHeader("Content-Type", "application/x-www-form-urlencoded");

    HttpResponse tokenHttpResponse = new DefaultHttpClient().execute(tokenRequest);
    return tokenHttpResponse.getEntity().getContent();
  }
View Full Code Here

      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

    }   

    // Seems broken in ARQ Alpha5
    //@Before
    public void init() {
        httpClient = new DefaultHttpClient();
        httpClient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, false);
    }
View Full Code Here

                                                 getStoreDefXml(),
                                                 getValidStoreName(),
                                                 RequestFormatType.VOLDEMORT_V1,
                                                 getLocalNode().getHttpPort());
        server = context.getServer();
        httpClient = new DefaultHttpClient();
        httpStore = ServerTestUtils.getHttpStore(getValidStoreName(),
                                                 RequestFormatType.VOLDEMORT_V1,
                                                 getLocalNode().getHttpPort(),
                                                 httpClient);
        url = getLocalNode().getHttpUrl().toString();
View Full Code Here

        server = context.getServer();

        ThreadSafeClientConnManager connectionManager = new ThreadSafeClientConnManager(SchemeRegistryFactory.createDefault(),
                                                                                        5000,
                                                                                        TimeUnit.MILLISECONDS);
        httpClient = new DefaultHttpClient(connectionManager);
        httpStore = ServerTestUtils.getHttpStore("users",
                                                 RequestFormatType.VOLDEMORT_V1,
                                                 node.getHttpPort(),
                                                 httpClient);
    }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.client.DefaultHttpClient

Copyright © 2018 www.massapicom. 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.