code: public void setContent(final byte[] content,
                           final String contentType) throws HttpException {
      if (!(method instanceof HttpEntityEnclosingRequestBase)) {
        throw new HttpException("Invalid operation for method " +
                                 method.getMethod());
      }
  
      final HttpEntityEnclosingRequestBase eem = (HttpEntityEnclosingRequestBase)method;
  
      ByteArrayEntity entity = new ByteArrayEntity(content);
      entity.setContentType(contentType);
      eem.setEntity(entity);
    }
docs: Send content
  
  @param content the content as bytes
  @param contentType its type
  @throws HttpException