code: public static void setEntity(HttpConnection connnection, String body, String contentType) {
          connnection.requestProperties.put("Content-type", contentType);
          connnection.setRequestBody(body);
      }
docs: Sets a JSON String as a request entity.
  
  @param connnection The request of {@link HttpConnection}
  @param body        The JSON String to set.