Package org.xlightweb.client

Examples of org.xlightweb.client.IHttpClientEndpoint.call()


   
    IServer server = new HttpServer(new RequestHandler());
    server.start();
   

    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "UTF-8", "Test"));
    String body = response.getBody().readString();
   
    server.close();
    httpClient.close();
   
View Full Code Here


    IServer server = new HttpServer(new EchoHandler());
    server.start();



    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen."));
    String body = response.getBlockingBody().readString();

    server.close();
    httpClient.close();
View Full Code Here

    IServer server = new HttpServer(new EchoHandler());
    server.start();



    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen."));
    String body = response.getBlockingBody().readString();

    server.close();
    httpClient.close();
View Full Code Here


    PostRequest postRequest = new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen.");
    postRequest.setTransferEncoding("chunked");

    IHttpResponse response = httpClient.call(postRequest);
    String body = response.getBlockingBody().readString();

    server.close();
    httpClient.close();
   
View Full Code Here

 
  @Test
  public void testLiveGet2() throws Exception {
    IHttpClientEndpoint httpClient = new HttpClient();
 
    IHttpResponse response = httpClient.call(new GetRequest("http://sourceforge.net/project/stats/index.php?group_id=169583&ugn=xsocket"));
    Assert.assertEquals(200, response.getStatus());
  }
 

View Full Code Here

  @Test
  public void testLiveGet() throws Exception {
    IHttpClientEndpoint httpClient = new HttpClient();
   
    IHttpResponse response = httpClient.call(new GetRequest("http://www.web.de/index.html"));
    Assert.assertEquals(302, response.getStatus());
  }
 
 
  @Test
View Full Code Here

   
    IServer server = new HttpServer(new RequestHandler());
    server.start();
   

    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "UTF-8", "Test"));
    String body = response.getBlockingBody().readString();
   
    server.close();
    httpClient.close();
   
View Full Code Here

    IServer server = new HttpServer(new EchoHandler());
    server.start();



    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen."));
    String body = response.getBlockingBody().readString();

    server.close();
    httpClient.close();
View Full Code Here

    IServer server = new HttpServer(new EchoHandler());
    server.start();



    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen."));
    String body = response.getBlockingBody().readString();

    server.close();
    httpClient.close();
View Full Code Here


    PostRequest postRequest = new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen.");
    postRequest.setTransferEncoding("chunked");

    IHttpResponse response = httpClient.call(postRequest);
    String body = response.getBlockingBody().readString();

    server.close();
    httpClient.close();
   
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.