Just to share an idea I thought would be worth trying: consider how the
MediaTypeWithQualityHeaderValue class seems to be designed for automatically formatting media types with quality precedence value (based on what I’m reading from the documentation on this class) per the format defined in RFC2616 §14.1. I think then that it might be worth trying the more generic class
MediaTypeHeaderValue (see Documentation).
The format of the
Accept header required by our REST API doesn’t specify multiple media types with their own quality values, but rather specifies one media type with a special
version=n concatenated to the end of it to specify versioning. That might be why the
MediaTypeWithQualityHeaderValue class isn’t accepting the format.
This is just conjecture, but might be that one of the
; characters are “confusing” it, because they would normally show up after a media type (in a value declaration), with a space in between the value and the media type.