code: public JsonNode sendJsonRequest(String requestMethod, Map<String,String> parameters) throws IOException, MediaWikiApiErrorException {
  		parameters.put(ApiConnection.PARAM_FORMAT, "json");
  		if (loggedIn) {
  			parameters.put(ApiConnection.ASSERT_PARAMETER, "user");
  		}
  		try (InputStream response = sendRequest(requestMethod, parameters)) {
  			JsonNode root = this.mapper.readTree(response);
  			this.checkErrors(root);
  			this.logWarnings(root);
  			return root;
  		}
  	}
docs: Sends a request to the API with the given parameters and the given
  request method and returns the result JSON tree. It automatically fills the
  cookie map with cookies in the result header after the request.
  It logs the request warnings and adds makes sure that "format": "json"
  parameter is set.
  
  @param requestMethod
  either POST or GET
  @param parameters
  Maps parameter keys to values. Out of this map the function
  will create a query string for the request.
  @return API result
  @throws IOException
  @throws MediaWikiApiErrorException if the API returns an error