Examples of IHttpRequestHandler


Examples of org.xlightweb.IHttpRequestHandler

public final class HttpClientDoubleCacheHandlerTest  {

    @Test
    public void testGetWithExpireHeader() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                exchange.send(resp);
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

    @Test
    public void testSimple() throws Exception {
        System.out.println("testSimple");
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            @Supports100Continue
            public void onRequest(IHttpExchange exchange) throws IOException {
               
                IHttpRequest request = exchange.getRequest();
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

    @Test
    public void testSimple() throws Exception {
        System.out.println("testSimple");
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            @Supports100Continue
            public void onRequest(IHttpExchange exchange) throws IOException {
               
                IHttpRequest request = exchange.getRequest();
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

    @Test
    public void testSimple() throws Exception {
        System.out.println("testSimple");
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            @Supports100Continue
            public void onRequest(IHttpExchange exchange) throws IOException {
               
                IHttpRequest request = exchange.getRequest();
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

      };
      final IServer oldServer = new Server(dh);
      oldServer.start();
     
     
      IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
       
          public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
              HttpClientConnection con = new HttpClientConnection("localhost", oldServer.getLocalPort());
              IHttpResponse response = con.call(new GetRequest("http://localhost:" + oldServer.getLocalPort() + "/"));
             
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

      };
     
      final IServer server = new Server(dh);
      server.start();
     
      IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
         
          public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
             
              IHttpRequest request = exchange.getRequest();
              URL url = request.getRequestUrl();
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

  
  @Test
  public void testGetWithExpireHeader() throws Exception {
     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                exchange.send(resp);
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

 
  @Ignore
    @Test
    public void testGetWithExpireHeaderAndPOST() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                exchange.send(resp);
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

 

    @Test
    public void testGetWithExpireAndCacheControlHeader() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                resp.setHeader("Cache-Control", "public, max-age=21600");
View Full Code Here

Examples of org.xlightweb.IHttpRequestHandler

   
   
    @Test
    public void testNegativeExpired() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "-1");
                exchange.send(resp);
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.