class ParseRESTCommand extends ParseRequest<JSONObject> {

  @Override
  protected ParseHttpBody newBody(ProgressCallback uploadProgressCallback) {
    if (jsonParameters == null) {
      String message = String.format("Trying to execute a %s command without body parameters.",
          method.toString());
      throw new IllegalArgumentException(message);
    }

    try {
      JSONObject parameters = jsonParameters;
      if (method == ParseHttpRequest.Method.GET ||
          method == ParseHttpRequest.Method.DELETE) {
        // The request URI may be too long to include parameters in the URI.
        // To avoid this problem we send the parameters in a POST request json-encoded body
        // and add a http method override parameter.
        parameters = new JSONObject(jsonParameters.toString());
        parameters.put(PARAMETER_METHOD_OVERRIDE, method.toString());
      }
      return new ParseByteArrayHttpBody(parameters.toString(), "application/json");
    } catch (Exception e) {
      throw new RuntimeException(e.getMessage());
    }
  }

  public  ParseRESTCommand(
      String httpPath,
      ParseHttpRequest.Method httpMethod,
      Map<String, ?> parameters,
      String sessionToken);
  public  ParseRESTCommand(
      String httpPath,
      ParseHttpRequest.Method httpMethod,
      JSONObject jsonParameters,
      String sessionToken);
  private  ParseRESTCommand(
      String httpPath,
      ParseHttpRequest.Method httpMethod,
      JSONObject jsonParameters,
      String localId, String sessionToken);
    ParseRESTCommand(Init<?> builder);

}