def is_form_media_type(media_type):
 (base_media_type, params) = parse_header(media_type.encode(HTTP_HEADER_ENCODING))
 return ((base_media_type == u'application/x-www-form-urlencoded') or (base_media_type == u'multipart/form-data'))

def is_form_media_type ( media_type ) : ( base_media_type , params ) = parse_header ( media_type . encode ( HTTP_HEADER_ENCODING ) ) return ( ( base_media_type == u'application/x-www-form-urlencoded' ) or ( base_media_type == u'multipart/form-data' ) )
return true if the media type is a valid form media type .