code: private String getRequestHeaderContentType() {
          String contentType = getRequestHeaderValue("Content-Type");
          if (contentType != null) {
              // remove parameter (Content-Type := type "/" subtype *[";" parameter] )
              int index = contentType.indexOf(';');
              if (index > 0)
                  contentType = contentType.substring(0, index);
              contentType = contentType.trim();
          }
          return contentType;
      }
docs: get Content-Type from URLConnection