Package org.xlightweb

Examples of org.xlightweb.HttpRequestHeader


       
        for (int i = 0; i < 100; i++) {
            HttpClientConnection con = pool.getHttpClientConnection("localhost", container.getLocalPort());
           
            FutureResponseHandler respHdl = new FutureResponseHandler();
            BodyDataSink dataSink = con.send(new HttpRequestHeader("POST", "http://localhost:" + container.getLocalPort() + "/test"), respHdl);
           
            dataSink.write("test");
           
            IHttpResponse response = respHdl.getResponse();
            Assert.assertEquals(200, response.getStatus());
View Full Code Here


      HttpServer server = new HttpServer(reqHdl);
      server.start();
     
      HttpClient httpClient = new HttpClient();
      FutureResponseHandler respHdl = new FutureResponseHandler();
      BodyDataSink ds = httpClient.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/?isWaitForBody=true", "text/plain;charset=UTF-8"), respHdl);
      ds.flush();
     
      QAUtil.sleep(1000);
      ds.write("1234567");
      ds.close();
View Full Code Here

        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        FutureResponseHandler respHdl = new FutureResponseHandler();
        BodyDataSink ds = httpClient.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/", "text/plain;charset=UTF-8"), respHdl);
        ds.flush();
       
        QAUtil.sleep(1000);
        ds.write("1234567");
        ds.close();
View Full Code Here

        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        FutureResponseHandler respHdl = new FutureResponseHandler();
        BodyDataSink ds = httpClient.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/", "text/plain;charset=UTF-8"), respHdl);
        ds.flush();
       
        QAUtil.sleep(1000);

        ds.close();
View Full Code Here

   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    con.setConnectionTimeoutMillis(1000);
   
    ResponseHandler respHdl = new ResponseHandler();
    HttpRequestHeader reqHdr = new HttpRequestHeader("POST", "/");

    BodyDataSink bodyDataSink = con.send(reqHdr, respHdl);
    bodyDataSink.write("er");
   
    QAUtil.sleep(1500);
View Full Code Here

   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    con.setConnectionTimeoutMillis(1000);
   
    ResponseHandler2 respHdl = new ResponseHandler2();
    HttpRequestHeader reqHdr = new HttpRequestHeader("POST", "/");

    BodyDataSink bodyDataSink = con.send(reqHdr, respHdl);
    bodyDataSink.write("er");
   
    QAUtil.sleep(2000);
View Full Code Here

   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    con.setResponseTimeoutMillis(1000);
   
    ResponseHandler respHdl = new ResponseHandler();
    HttpRequestHeader reqHdr = new HttpRequestHeader("GET", "/");
    reqHdr.setHeader("sleep-time", Integer.toString(1000));

    con.send(reqHdr, respHdl);
   
    QAUtil.sleep(1500);
   
View Full Code Here

   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    con.setResponseTimeoutMillis(1000);
   
    ResponseHandler2 respHdl = new ResponseHandler2();
    HttpRequestHeader reqHdr = new HttpRequestHeader("GET", "/");
    reqHdr.setHeader("sleep-time", Integer.toString(1000));

    con.send(reqHdr, respHdl);
   
    QAUtil.sleep(1500);
   
View Full Code Here

     
      con = new HttpClientConnection(host, port);
    }
   
    public void open() throws IOException {
      outChannel = con.send(new HttpRequestHeader("POST", "/Heartbeat/RegisterClient", "text/plain; charset=ISO-8859-1"), this);
      outChannel.setFlushmode(FlushMode.ASYNC);
      outChannel.flush();
    }
View Full Code Here

    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
 
       
    FutureResponseHandler hdl = new FutureResponseHandler();
   
    BodyDataSink sink = con.send(new HttpRequestHeader("POST", "/", "text/plain; charset=iso-8859-1"), hdl);
    sink.flush();
   
    BlockingBodyDataSource source = hdl.getResponse().getBlockingBody();
   
    sink.write("test\r\n");
View Full Code Here

TOP

Related Classes of org.xlightweb.HttpRequestHeader

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.