Package org.vietspider.net.client

Examples of org.vietspider.net.client.HttpResponseReader


      if(httpGet == null) return null;
      HttpHost httpHost = webClient.createHttpHost(address);
      HttpResponse httpResponse = webClient.execute(httpHost, httpGet);

      HttpResponseReader httpResponseReader = new HttpResponseReader();
      return httpResponseReader.readBody(httpResponse);
    } catch(Exception exp) {
      throw exp;
    }
  }
View Full Code Here


    httpGet = webClient.createGetMethod("http://mail.google.com/mail/", "http://gmail.com");
    response = webClient.execute(httpHost, httpGet);
    entity = response.getEntity();

    HttpResponseReader httpResponseReader = new HttpResponseReader();
    byte [] bytes = httpResponseReader.readBody(response);
    new DataWriter().save(new File("google_mail.html"), bytes);

    System.out.println("Login form get: " + response.getStatusLine());
    if (entity != null) entity.consumeContent();
View Full Code Here

      if(httpGet == null) return null;
      HttpHost httpHost = webClient.createHttpHost(address);
      HttpResponse httpResponse = webClient.execute(httpHost, httpGet);

      HttpResponseReader httpResponseReader = HttpHandlers.getInstance().createReader();
      return httpResponseReader.readBody(httpResponse);
    } catch(Exception exp) {
      throw exp;
    }
  }
View Full Code Here

  httpGet = webClient.createGetMethod("http://my.yahoo.com", "http://www.yahoo.com");
    response = webClient.execute(httpHost, httpGet);
    entity = response.getEntity();


    HttpResponseReader httpResponseReader = new HttpResponseReader();
    byte [] bytes = httpResponseReader.readBody(response);
    new DataWriter().save(new File("my_yahoo.html"), bytes);

    System.out.println("Login form get: " + response.getStatusLine());
    if (entity != null) entity.consumeContent();
View Full Code Here

    HttpResponse httpResponse = webClient.execute(httpHost, httpGet);

    int statusCode = httpResponse.getStatusLine().getStatusCode();
    System.out.println(" status code is "+ statusCode);

    HttpResponseReader httpResponseReader = new HttpResponseReader();
    return httpResponseReader.readBody(httpResponse);
  }
View Full Code Here

      URLEncoder urlEncoder = new URLEncoder();
      address = urlEncoder.encode(address);
     
      HttpResponse httpResponse = methodHandler.execute(address, "");
     
      HttpResponseReader httpResponseReader = HttpHandlers.getInstance().createReader();
      return httpResponseReader.readBody(httpResponse);
    } catch(Exception exp){
      return null;
    }
  }
View Full Code Here

    httpGet = webClient.createGetMethod("http://java.net/", "http://java.net/");
    response = webClient.execute(httpHost, httpGet);
    entity = response.getEntity();

    HttpResponseReader httpResponseReader = new HttpResponseReader();
    byte [] bytes = httpResponseReader.readBody(response);
    new DataWriter().save(new File("java_net.html"), bytes);

    System.out.println("Login form get: " + response.getStatusLine());
    if (entity != null) entity.consumeContent();
View Full Code Here

      }
      default:
        break;
    }

    HttpResponseReader responseReader = HttpHandlers.getInstance().createReader();
    byte [] data = responseReader.readBody(response);
    return data;
  }
View Full Code Here

      httpMethod.abort();
      return SUCCESSFULL;
    }
//    long end = System.currentTimeMillis();
//    System.out.println("mat "+ (end - start));
    HttpResponseReader reader = HttpHandlers.getInstance().createReader();
    byte [] bytes = reader.readBody(response2);
   
    if(errorDetector != null && errorDetector.isError(bytes)) return ERROR;
   
    if(checkTimeout(bytes)) return TIMEOUT; 
   
View Full Code Here

      }
      default:
        break;
    }

    HttpResponseReader responseReader = HttpHandlers.getInstance().createReader();
    byte [] data = responseReader.readBody(response);
    return data;
  }
View Full Code Here

TOP

Related Classes of org.vietspider.net.client.HttpResponseReader

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.