54 writes to Value
Microsoft.Net.Http.Headers (7)
ContentDispositionHeaderValue.cs (3)
186sizeParameter.Value = value.GetValueOrDefault().ToString(CultureInfo.InvariantCulture); 390dateParameter.Value = dateString; 455nameParameter.Value = processedValue;
HeaderUtilities.cs (1)
39qualityParameter.Value = qualityString;
MediaTypeHeaderValue.cs (2)
96charsetParameter.Value = value; 170boundaryParameter.Value = value;
NameValueHeaderValue.cs (1)
199Value = HeaderUtilities.EscapeAsQuotedString(value);
Microsoft.Net.Http.Headers.Tests (47)
NameValueHeaderValueTest.cs (47)
68pair0.Value = "othervalue"; 86pair0.Value = "othervalue"; 89Assert.Throws<InvalidOperationException>(() => { pair1.Value = "othervalue"; }); 102pair0.Value = "othervalue"; 119pair0.Value = "othervalue"; 122Assert.Throws<InvalidOperationException>(() => { pair1.Value = "othervalue"; }); 136pair2.Value = "othervalue"; 145Assert.Throws<FormatException>(() => { var x = new NameValueHeaderValue("name"); x.Value = " x "; }); 146Assert.Throws<FormatException>(() => { var x = new NameValueHeaderValue("name"); x.Value = "x y"; }); 155nameValue.Value = "\"quoted string\""; 158nameValue.Value = null; 161nameValue.Value = string.Empty; 171nameValue1.Value = null; 172nameValue2.Value = null; 175nameValue1.Value = "token"; 176nameValue2.Value = null; 179nameValue1.Value = "token"; 180nameValue2.Value = string.Empty; 183nameValue1.Value = null; 184nameValue2.Value = string.Empty; 187nameValue1.Value = "token"; 188nameValue2.Value = "TOKEN"; 191nameValue1.Value = "token"; 192nameValue2.Value = "token"; 195nameValue1.Value = "\"quoted string\""; 196nameValue2.Value = "\"QUOTED STRING\""; 199nameValue1.Value = "\"quoted string\""; 200nameValue2.Value = "\"quoted string\""; 218nameValue1.Value = null; 219nameValue2.Value = null; 222nameValue1.Value = "token"; 223nameValue2.Value = null; 226nameValue1.Value = null; 227nameValue2.Value = "token"; 230nameValue1.Value = string.Empty; 231nameValue2.Value = "token"; 234nameValue1.Value = null; 235nameValue2.Value = string.Empty; 238nameValue1.Value = "token"; 239nameValue2.Value = "TOKEN"; 242nameValue1.Value = "token"; 243nameValue2.Value = "token"; 246nameValue1.Value = "\"quoted string\""; 247nameValue2.Value = "\"QUOTED STRING\""; 250nameValue1.Value = "\"quoted string\""; 251nameValue2.Value = "\"quoted string\""; 625header.Value = input;
63 references to Value
Microsoft.Net.Http.Headers (20)
CacheControlHeaderValue.cs (6)
624success = ((nameValue.Value == null) || TrySetTimeSpan(nameValue, ref cc._maxStaleLimit)); 700if (nameValue.Value != null) 714if (nameValue.Value == null) 722var valueString = nameValue.Value; 773if (nameValue.Value == null) 779if (!HeaderUtilities.TryParseNonNegativeInt32(nameValue.Value, out seconds))
ContentDispositionHeaderValue.cs (5)
161var sizeString = sizeParameter.Value; 357var dateString = dateParameter.Value; 410if (TryDecode5987(nameParameter.Value, out result)) 418if (TryDecodeMime(nameParameter.Value, out result)) 423return HeaderUtilities.RemoveQuotes(nameParameter.Value);
HeaderUtilities.cs (1)
63if (TryParseQualityDouble(qualityParameter.Value, 0, out var qualityValue, out _))
MediaTypeHeaderValue.cs (4)
76return NameValueHeaderValue.Find(_parameters, CharsetString)?.Value ?? default; 152return NameValueHeaderValue.Find(_parameters, BoundaryString)?.Value ?? default(StringSegment); 812if (!StringSegment.Equals(parameter.Value, localParameter.Value, StringComparison.OrdinalIgnoreCase))
NameValueHeaderValue.cs (4)
176/// <returns>An unescaped version of <see cref="Value"/>.</returns> 187/// Sets <see cref="Value"/> after it has been quoted as defined by <see href="https://tools.ietf.org/html/rfc7230#section-3.2.6">the RFC specification</see>. 299if (!StringSegment.IsNullOrEmpty(values[i].Value)) 302destination.Append(values[i].Value.AsSpan());
Microsoft.Net.Http.Headers.Tests (43)
ContentDispositionHeaderValueTest.cs (12)
136Assert.Equal("\"=?utf-8?B?RmlsZcODTmFtZS5iYXQ=?=\"", contentDisposition.Parameters.First().Value.AsSpan()); 151Assert.Equal("\"=?utf-8?B?RmlsZQpOYW1lLmJhdA==?=\"", contentDisposition.Parameters.First().Value.AsSpan()); 167Assert.Equal("\"=?utf-99?Q?R=mlsZcODTmFtZS5iYXQ=?=\"", contentDisposition.Parameters.First().Value.AsSpan()); 195Assert.Equal("UTF-8\'\'new_name", contentDisposition.Parameters.First().Value.AsSpan()); 210Assert.Equal("UTF-8\'\'File%C3%83Name.bat", contentDisposition.Parameters.First().Value.AsSpan()); 221Assert.Equal($"UTF-8\'\'a%C2%80b", contentDisposition.Parameters.First().Value.AsSpan()); //%C2 added because the value in UTF-8 is encoded on 2 bytes. 229Assert.Equal($"UTF-8\'\'{new string('a', 400)}", contentDisposition.Parameters.First().Value.AsSpan()); 253Assert.Equal($"UTF-8\'\'a%{hexC}b", contentDisposition.Parameters.First().Value.AsSpan()); 257Assert.Equal($"UTF-8\'\'a{(char)b}b", contentDisposition.Parameters.First().Value.AsSpan()); 273Assert.Equal("utf-99'lang'File%CZName.bat", contentDisposition.Parameters.First().Value.AsSpan()); 322Assert.Equal("\"Tue, 15 Nov 1994 08:12:32 GMT\"", contentDisposition.Parameters.First().Value.AsSpan()); 660Assert.Equal("UTF-8\'\'File%20%F0%9F%A4%A9%20name.txt", contentDisposition.Parameters[1].Value.AsSpan());
MediaTypeHeaderValueTest.cs (7)
166Assert.Same(pair0.Value.Value, pair1.Value.Value); 194Assert.Same(pair0.Value.Value, pair1.Value.Value); 217Assert.Same(pair2.Value.Value, pair1.Value.Value); 273Assert.Equal("0.563", mediaType.Parameters.First().Value.AsSpan());
NameValueHeaderValueTest.cs (24)
64Assert.Null(pair0.Value.Value); 65Assert.Null(pair1.Value.Value); 69Assert.Equal("othervalue", pair0.Value.AsSpan()); 70Assert.Null(pair1.Value.Value); 80Assert.Null(pair0.Value.Value); 81Assert.Null(pair1.Value.Value); 87Assert.Equal("othervalue", pair0.Value.AsSpan()); 88Assert.Null(pair1.Value.Value); 99Assert.Same(pair0.Value.Value, pair1.Value.Value); 103Assert.Equal("othervalue", pair0.Value.AsSpan()); 104Assert.Equal("value", pair1.Value.AsSpan()); 114Assert.Same(pair0.Value.Value, pair1.Value.Value); 120Assert.Equal("othervalue", pair0.Value.AsSpan()); 121Assert.Equal("value", pair1.Value.AsSpan()); 133Assert.Same(pair0.Value.Value, pair1.Value.Value); 137Assert.Equal("othervalue", pair2.Value.AsSpan()); 138Assert.Equal("value", pair1.Value.AsSpan()); 603var actual = header.Value; 629var actual = header.Value; 643var actual = header.Value; 676Assert.Equal(value.AsSpan(), nameValue.Value);