public String selectHeaderContentType(String[] contentTypes) {
    if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
      return "application/json";
    }
    for (String contentType : contentTypes) {
      if (isJsonMime(contentType)) {
        return contentType;
      }
    }
    return contentTypes[0];
  }
Select the Content-Type header's value from the given array:
  if JSON exists in the given array, use it;
  otherwise use the first one of the array.

@param contentTypes The Content-Type array to select from
@return The Content-Type header to use. If the given array is empty,
  or matches "any", JSON will be used.
plc4j/drivers/ctrlx/src/main/java/org/apache/plc4x/java/ctrlx/readwrite/rest/datalayer/ApiClient.java