Code example for HttpMessage

Methods: addHeader

   * @param request the request to modify 
   * @see #getUngzippedContent 
  public static void modifyRequestToAcceptGzipResponse(HttpMessage request) {
    request.addHeader("Accept-Encoding", "gzip");
   * Gets the input stream from a response entity.  If the entity is gzipped 
   * then this will get a stream over the uncompressed data. 
   * @param entity the entity whose content should be read 
   * @return the input stream to read from 
   * @throws IOException 
  public static InputStream getUngzippedContent(HttpEntity entity) throws IOException {
    InputStream responseStream = entity.getContent();
    if (responseStream == null) {
      return responseStream;
Experience pair programming with AI  Get Codota for Java