static void validateDataAndHeader(HttpRequest request, List<String> supportedContentTypes) {
        if (request.getData() == null)
            throw new BadRequestException("Request contains no data");

        String header = request.getHeader(ApplicationApiHandler.contentTypeHeader);
        if (header == null)
            throw new BadRequestException("Request contains no " + ApplicationApiHandler.contentTypeHeader + " header");

        ContentType contentType = ContentType.parse(header);
        if ( ! supportedContentTypes.contains(contentType.getMimeType()))
            throw new BadRequestException("Request contains invalid " + ApplicationApiHandler.contentTypeHeader +
                                                  " header (" + contentType.getMimeType() + "), only '[" +
                                                  String.join(", ", supportedContentTypes) + "]' are supported");
    }
A handler that is able to create a session from an application package,
or create a new session from a previous session (with id or the "active" session).
Handles /application/v2/ requests

@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/SessionCreateHandler.java