Examples of BasicHttpParams


Examples of org.apache.http.params.BasicHttpParams

  @Test
  public void putTest() throws ClientProtocolException, IOException {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new BasicHeader("Connection", "Close"));
    HttpParams params = new BasicHttpParams();
    params.setParameter("http.default-headers", headers);

    HttpClient httpclient = new DefaultHttpClient(params);
    HttpPut httpput = new HttpPut("http://localhost:" + PORT + "/put");
    HttpResponse response = httpclient.execute(httpput);
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

  @Test
  public void capturingTest() throws ClientProtocolException, IOException {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new BasicHeader("Connection", "Close"));
    HttpParams params = new BasicHttpParams();
    params.setParameter("http.default-headers", headers);

    HttpClient httpclient = new DefaultHttpClient(params);
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/capturing/1911");
    HttpResponse response = httpclient.execute(httpget);
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

  @Test
  public void erroneousCapturingTest() throws ClientProtocolException, IOException {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new BasicHeader("Connection", "Close"));
    HttpParams params = new BasicHttpParams();
    params.setParameter("http.default-headers", headers);

    HttpClient httpclient = new DefaultHttpClient(params);
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/capturing/r1911");
    HttpResponse response = httpclient.execute(httpget);
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

  @Test
  public void keepAliveRequestTest() throws ClientProtocolException, IOException {
    List<Header> headers = new LinkedList<Header>();
    headers.add(new BasicHeader("Connection", "Keep-Alive"));
    HttpParams params = new BasicHttpParams();
    params.setParameter("http.default-headers", headers);

    DefaultHttpClient httpclient = new DefaultHttpClient(params);

    for (int i = 1; i <= 25; i++) {
      doKeepAliveRequestTest(httpclient);
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

    assertEquals(expectedPayload, payLoad);
  }

  @Test
  public void HTTP_1_0_noConnectionHeaderTest() throws ClientProtocolException, IOException {
    HttpParams params = new BasicHttpParams();
    HttpProtocolParams.setVersion(params, new ProtocolVersion("HTTP", 1, 0));
    DefaultHttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/");
    HttpResponse response = httpclient.execute(httpget);
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

                                         Boolean allowCircularRedirects,
                                         int connTimeout, int socketTimeout,
                                         String cookiePolicy, SSLContext sslContext,
                                         X509HostnameVerifier hostnameVerifier)
    {
        HttpParams httpParams = new BasicHttpParams();

        SchemeRegistry registry = new SchemeRegistry();

        registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        SSLSocketFactory sslSocketFactory;
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

   }


   private ApacheHttpClient4Executor createClient()
   {
      HttpParams params = new BasicHttpParams();
      ConnManagerParams.setMaxTotalConnections(params, 3);
      ConnManagerParams.setTimeout(params, 1000);

      // Create and initialize scheme registry
      SchemeRegistry schemeRegistry = new SchemeRegistry();
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

    schemeRegistry.register(new Scheme("https", 443, getSSLSocketFactory()));

    final ThreadSafeClientConnManager clientConnectionManager = new ThreadSafeClientConnManager(schemeRegistry);

    // Create and initialize HTTP parameters
    final HttpParams httpParams = new BasicHttpParams();
    /**
     * ConnectionManager settings
     */
    // how much connections do we need? - default: 20
    clientConnectionManager.setMaxTotal(maxcon);
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

        if (connectionManager != null) {
            return;
        }
        // Create client-side I/O reactor
        final IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch(new HttpAsyncRequestExecutor(),
                                                                                new BasicHttpParams());
        ioReactor = new DefaultConnectingIOReactor(config);
       

        // Run the I/O reactor in a separate thread
        Thread t = new Thread(new Runnable() {
View Full Code Here

Examples of org.apache.http.params.BasicHttpParams

    }



    public void testSetGet() {
        HttpParams params = new BasicHttpParams();

        assertNull("phantom proxy",
                   ConnRouteParams.getDefaultProxy(params));
        assertNull("phantom route",
                   ConnRouteParams.getForcedRoute(params));
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.