Examples of HttpClient


Examples of org.apache.http.client.HttpClient

    // TODO RS 101026 Verify that the actual body/entity is 2145094 bytes big (when we have support for "large" file)
  }

  @Test
  public void noBodyRequest() throws ClientProtocolException, IOException {
    HttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/no_body");
    HttpResponse response = httpclient.execute(httpget);
    List<String> expectedHeaders = Arrays.asList(new String[] {"Server", "Date", "Content-Length", "Connection"});

    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.client.HttpClient

    assertEquals("0", response.getFirstHeader("Content-Length").getValue());
  }

  @Test
  public void movedPermanentlyRequest() throws ClientProtocolException, IOException {
    HttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/moved_perm");
    HttpResponse response = httpclient.execute(httpget);
    List<String> expectedHeaders = Arrays.asList(new String[] {"Server", "Date", "Content-Length", "Connection", "Etag"});

    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.client.HttpClient

    assertEquals("Authentication failed", payLoad);
  }
 
  @Test
  public void queryParamsTest() throws ClientProtocolException, IOException {
    HttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("http://localhost:" + PORT + "/query_params?key1=value1&key2=value2");
    HttpResponse response = httpclient.execute(httpget);
    List<String> expectedHeaders = Arrays.asList(new String[] {"Server", "Date", "Content-Length", "Etag", "Connection"});

    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.mockup.HttpClient

    private HttpServer server;
    private HttpClient client;

    protected void setUp() throws Exception {
        this.server = new HttpServer();
        this.client = new HttpClient();
    }
View Full Code Here

Examples of org.apache.http.testserver.HttpClient

        this.server = new HttpServer();
    }

    @Before
    public void initClient() throws Exception {
        this.client = new HttpClient();
    }
View Full Code Here

Examples of org.apache.oodt.cas.pushpull.protocol.http.HttpClient

*/
public class HttpClientFactory implements ProtocolFactory {

    public Protocol newInstance() {
        try {
            return new HttpClient();
        } catch (Exception e) {
            System.out
                    .println("ERROR: creating HttpClient - check httpclient.properties");
            return null;
        }
View Full Code Here

Examples of org.eclipse.ecf.internal.provider.rss.http.HttpClient

  }

  protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
    trace("createConnection:" + remoteSpace + ":" + data);
    // Object[] args = { new Integer(keepAlive) };
    final ISynchAsynchConnection conn = new HttpClient(receiver);
    return conn;
  }
View Full Code Here

Examples of org.eclipse.jetty.client.HttpClient

    @Test
    public void testLogin() throws Exception {

        final SslContextFactory sslContextFactory = new SslContextFactory();
        sslContextFactory.setSslContext(new SSLContextParameters().createSSLContext());
        final HttpClient httpClient = new HttpClient(sslContextFactory);
        httpClient.setConnectTimeout(TIMEOUT);
        httpClient.setTimeout(TIMEOUT);
        httpClient.registerListener(RedirectListener.class.getName());
        httpClient.start();

        final SalesforceSession session = new SalesforceSession(
            httpClient, LoginConfigHelper.getLoginConfig());
        session.addListener(this);
View Full Code Here

Examples of org.eclipse.webdav.http.client.HttpClient

    /**
     * Ctor for this wrapper WebDav client.
     * @param serverUrl The WebDav repository location (server)
     */
    /** package */ WebDavClient(URL serverUrl) {
        HttpClient httpClient = null;
        if (Activator.getDefault().useDebugHttpClient()) {
            httpClient = new DebugHttpClient();
        } else {
            httpClient = new HttpClient();
        }
        platformAuthenticator =  new WebDavAuthenticator(serverUrl);
        httpClient.setAuthenticator(platformAuthenticator);
        client = new RemoteDAVClient(new WebDAVFactory(), httpClient);
    }
View Full Code Here

Examples of org.ektorp.http.HttpClient

    joinDetails(orderdetails2, orders2);
   
    System.out.println("Data prepared.");
   
    //put things in database
    HttpClient couchClient=null;
    try {
      couchClient = new StdHttpClient.Builder()
      .username("admin")
      .password("admin")
      .url("http://localhost:5984")
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.