func (r Route) matchesContentType(mimeTypes string) bool {
	if len(r.Consumes) == 0 {
		return true
	}
	if len(mimeTypes) == 0 {
		m := r.Method
		if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" {
			return true
		}
		mimeTypes = MIME_OCTET
	}
	remaining := mimeTypes
	for {
		var mimeType string
		if end := strings.Index(remaining, ","); end == -1 {
			mimeType, remaining = remaining, ""
		} else {
			mimeType, remaining = remaining[:end], remaining[end+1:]
		}
		if quality := strings.Index(mimeType, ";"); quality != -1 {
			mimeType = mimeType[:quality]
		}
		mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset)
		for _, consumeableType := range r.Consumes {
			if consumeableType == "*/*" || consumeableType == mimeType {
				return true
			}
		}
		if len(remaining) == 0 {
			return false
		}
	}
}
Return whether this Route can consume content with a type specified by mimeTypes (can be empty).
package restful
import (
	"net/http"
	"strings"
)
type RouteFunction func(*Request, *Response)
type RouteSelectionConditionFunction func(httpRequest *http.Request) bool
type Route struct {
	Method   string
	Produces []string
	Consumes []string
	Path     string  
	Function RouteFunction
	Filters  []FilterFunction
	If       []RouteSelectionConditionFunction
	relativePath string
	pathParts    []string
	pathExpr     *pathExpression  
	Doc                     string
	Notes                   string
	Operation               string
	ParameterDocs           []*Parameter
	ResponseErrors          map[int]ResponseError
	DefaultResponse         *ResponseError
	ReadSample, WriteSample interface{}  
	Metadata map[string]interface{}
	Deprecated bool
	contentEncodingEnabled *bool
}
func (r *Route) postBuild() {
	r.pathParts = tokenizePath(r.Path)
}
func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request, pathParams map[string]string) (*Request, *Response) {
	wrappedRequest := NewRequest(httpRequest)
	wrappedRequest.pathParameters = pathParams
	wrappedRequest.selectedRoutePath = r.Path
	wrappedResponse := NewResponse(httpWriter)
	wrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept)
	wrappedResponse.routeProduces = r.Produces
	return wrappedRequest, wrappedResponse
}
func (r *Route) dispatchWithFilters(wrappedRequest *Request, wrappedResponse *Response) {
	if len(r.Filters) > 0 {
		chain := FilterChain{Filters: r.Filters, Target: r.Function}
		chain.ProcessFilter(wrappedRequest, wrappedResponse)
	} else {
		r.Function(wrappedRequest, wrappedResponse)
	}
}
func stringTrimSpaceCutset(r rune) bool {
	return r == ' '
}
func (r Route) matchesAccept(mimeTypesWithQuality string) bool {
	remaining := mimeTypesWithQuality
	for {
		var mimeType string
		if end := strings.Index(remaining, ","); end == -1 {
			mimeType, remaining = remaining, ""
		} else {
			mimeType, remaining = remaining[:end], remaining[end+1:]
		}
		if quality := strings.Index(mimeType, ";"); quality != -1 {
			mimeType = mimeType[:quality]
		}
		mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset)
		if mimeType == "*/*" {
			return true
		}
		for _, producibleType := range r.Produces {
			if producibleType == "*/*" || producibleType == mimeType {
				return true
			}
		}
		if len(remaining) == 0 {
			return false
		}
	}
}