code: private void attachRequestToBody(AbstractBceRequest request, InternalRequest httpRequest) {
          byte[] content;
          try {
              content = JsonUtils.toJsonString(request).getBytes("utf-8");
          } catch (UnsupportedEncodingException e) {
              throw new BceClientException("utf-8 encoding not supported!", e);
          }
          httpRequest.addHeader(Headers.CONTENT_LENGTH, String.valueOf(content.length));
          httpRequest.addHeader(Headers.CONTENT_TYPE, "application/json; charset=utf-8");
          httpRequest.setContent(RestartableInputStream.wrap(content));
      }
docs: put json object into http content for put or post request.
  
  @param request     json object of rest request
  @param httpRequest http request object