/// <summary> /// Sets the Accept media-type header value. To accept multiple media types, /// this method can be called multiple times. /// </summary> /// <returns>Self reference for method chaining.</returns> /// <param name="value">The media-type value.</param> /// <param name="quality">The precedence of the value compared in relation to /// other accept media-type values.</param> public RequestHeaders AcceptMediaType(string value, double?quality = null) { var acceptValues = Accept?.ToList() ?? new List <HeaderValue>(); acceptValues.Add(HeaderValue.WithValue(value, quality)); Accept = acceptValues.ToArray(); return(this); }