public FormData readFormData() 
	throws IOException,
	       HeaderFormatException,
	       DataFormatException,
	       UnsupportedFormatException {


	
	


	// Switch the request's 'Content-Type' field.
	HTTPHeaderLine hl_contentType = this.getRequestHeaders().get( HTTPHeaders.NAME_CONTENT_TYPE );  // This search is case-insensitive
	this.getLogger().log( Level.INFO,
			      getClass().getName() + ".readFormData()",
			      "Parsing POST data as MIME type '" + hl_contentType + "'." );

	
	// Is there a default value if not passed?
	if( hl_contentType == null 
	    || hl_contentType.getValue() == null
	    || hl_contentType.getValue().length() == 0 ) {

	    throw new HeaderFormatException( "Cannot parse post data. There is no 'Content-Type' present in the request header list." );
	}





	String hdr_contentType = hl_contentType.getValue(); 

	// This should be adapted to some general HeaderParams instance
	HeaderParams headerParams           = new HeaderParams( HTTPHeaders.NAME_CONTENT_TYPE, hdr_contentType ); 
	String param_contentType            = headerParams.getMainToken();
	String param_contentType_addonKey   = headerParams.getToken( param_contentType, false, 1, 0 ); 
	String param_contentType_addonValue = headerParams.getToken( param_contentType, false, 1, 1 ); 
	this.getLogger().log( Level.INFO,
			      getClass().getName() + ".readFormData()",
			      "param_contentType=" + param_contentType + ", param_contentType_addonKey=" + param_contentType_addonKey + ", param_contentType_addonValue=" + param_contentType_addonValue );


	// My supported content types are:
	//  - multipart/form-data; boundary=----WebKitFormBoundaryeANQMKoBwsmwQrYZ
	//  - application/x-www-form-urlencoded  (default?)
	
	if( param_contentType.equalsIgnoreCase("application/x-www-form-urlencoded") ) { 
	    // hl_contentType.getValue().startsWith("application/x-www-form-urlencoded") ) {

	    return readFormData_wwwFormURLEncoded( param_contentType, headerParams );

	} else if( param_contentType.equalsIgnoreCase("multipart/form-data") ) { 
	    // hl_contentType.getValue().startsWith("multipart/form-data") ) {

	    return readFormData_multiPartFormData( param_contentType, headerParams );

	} else {

	    throw new UnsupportedFormatException( "The POST data's content type is '" + param_contentType + "'. The server does not recognize this format." );

	}

    }