Examples of DefaultHttpClient


Examples of com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClient

      @Override
      public void apply(final Request request) {
        authenticationHandler.configure(request);
      }
    });
    final DefaultHttpClient defaultHttpClient = new DefaultHttpClient(new NoOpEventPublisher(),
        new RestClientApplicationProperties(serverUri),
        ThreadLocalContextManagers.noop(), options);
    return new AtlassianHttpClientDecorator(defaultHttpClient) {

      @Override
      public void destroy() throws Exception {
        defaultHttpClient.destroy();
      }
    };
  }
View Full Code Here

Examples of de.innovationgate.eclipse.utils.DefaultHttpClient

  }
 
  public HTTPContextInformationProvider() {
    IProxyService proxyService = Plugin.getDefault().getProxyService();
    try {
      _httpClient = new DefaultHttpClient(proxyService, new URI(BASE_URL));
    } catch (URISyntaxException e) {
      // should not happen
    }
    proxyService.addProxyChangeListener(this);    
  }
View Full Code Here

Examples of de.innovationgate.eclipse.utils.DefaultHttpClient

      return downloadWGA(monitor, getWGADownloadURL());
  }
 
   public TemporaryFile downloadWGA(IProgressMonitor monitor, String url) throws IllegalStateException, IOException, URISyntaxException {
        monitor.setTaskName("Downloading OpenWGA from '" + url + "'");                    
        HttpClient client = new DefaultHttpClient((IProxyService)_proxyServiceTracker.getService(), new URI(url));
        GetMethod get = new GetMethod(url);
    int result = client.executeMethod(get);
    if (result == HttpURLConnection.HTTP_OK) {
      long size = get.getResponseContentLength();               
            TemporaryFile temp = new TemporaryFile("wga.war", new ProgressMonitorInputStream(monitor, "Downloading OpenWGA ", size, get.getResponseBodyAsStream()), getStateLocation().toFile());
      return temp;
    } else {
View Full Code Here

Examples of org.apache.any23.http.DefaultHTTPClient

     */
    @Test
    public void testProgrammaticExtraction() throws ExtractionException, IOException, URISyntaxException {
        Any23 any23 = new Any23();
        any23.setHTTPUserAgent("Any23-Servlet");
        any23.setHTTPClient(new DefaultHTTPClient() {
            @Override
            protected int getConnectionTimeout() {
                return 5000;
            }

View Full Code Here

Examples of org.apache.cactus.client.connector.http.DefaultHttpClient

     * @exception Throwable if any error happens during the execution of
     *            the test
     */
    public void runTest() throws Throwable
    {
        runGenericTest(new DefaultHttpClient(
            (WebConfiguration) getConfiguration()));       
    }
View Full Code Here

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

    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);
    HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/delete");
    HttpResponse response = httpclient.execute(httpdelete);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
View Full Code Here

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

    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);
    HttpPost httppost = new HttpPost("http://localhost:" + PORT + "/post");
    HttpResponse response = httpclient.execute(httppost);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
View Full Code Here

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

    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);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
View Full Code Here

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

    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);

    assertNotNull(response);
    assertEquals(200, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("OK", response.getStatusLine().getReasonPhrase());
View Full Code Here

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

    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);

    assertNotNull(response);
    assertEquals(404, response.getStatusLine().getStatusCode());
    assertEquals(new ProtocolVersion("HTTP", 1, 1), response.getStatusLine().getProtocolVersion());
    assertEquals("Not Found", response.getStatusLine().getReasonPhrase());
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.