title: Http 416, Requested range not satisfiable
body: <p>I'm using http client to get data:</p>
  
  <pre><code>public static String getHttpResponse(String url) {
  
  //LOGGER.info("Download page context from URL " + url);
  String httpClientResponse = null;
  try {
    URI uri = new URIBuilder(url).build();
    HttpResponse response;
  
    HttpHost target = new HttpHost(uri.getHost());
    HttpGet request = new HttpGet(uri);
  
    //request.setConfig(config);
    request.addHeader(new BasicHeader("User-Agent", "Mozilla/5.0"));
    request.addHeader(new BasicHeader("Content-Type", "text/html"));
    request.addHeader("Accept-Ranges", "bytes=100-1500");
  
    org.apache.http.client.HttpClient
        client = HttpClients.custom().build();
  
    response = client.execute(target, request);
  
    //LOGGER.info("Status Line for URL {} is {}", uri.getHost() + File.separator + uri.getPath(), response.getStatusLine());
  
    InputStream inputStream = response.getEntity().getContent();
  
    if (inputStream == null || response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
      /*LOGGER.error("Non-success response while downloading image. Response {}", response.getStatusLine());
      LOGGER.error("Error while download data from url {}", url);*/
    } else {
      httpClientResponse = IOUtils.toString(inputStream, CharEncoding.UTF_8);
    }
  
  } catch (Exception e) {
    System.out.println("Error while download content from URL");
  }
  return httpClientResponse;
  }
  </code></pre>
  
  <p>Also: Can we do this using Jsoup? </p>
  
  <p>Thanks.</p>