code: func NegotiateOutputMediaType(req *http.Request, ns runtime.NegotiatedSerializer, restrictions EndpointRestrictions) (MediaTypeOptions, runtime.SerializerInfo, error) {
  	mediaType, ok := NegotiateMediaTypeOptions(req.Header.Get("Accept"), ns.SupportedMediaTypes(), restrictions)
  	if !ok {
  		supported, _ := MediaTypesForSerializer(ns)
  		return mediaType, runtime.SerializerInfo{}, NewNotAcceptableError(supported)
  	}
  	// TODO: move into resthandler
  	info := mediaType.Accepted
  	if (mediaType.Pretty || isPrettyPrint(req)) && info.PrettySerializer != nil {
  		info.Serializer = info.PrettySerializer
  	}
  	return mediaType, info, nil
  }
docs: // NegotiateOutputMediaType negotiates the output structured media type and a serializer, or
  // returns an error.