Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Net.​Http.​Headers.​NameValueHeaderValue
Assembly: Microsoft.Net.Http.Headers
Inheritance: object → NameValueHeaderValue
Represents a name/value pair used in various headers as defined in RFC 2616.
Properties
Gets the header name.
Gets or sets the header value.
public
bool
IsReadOnly
Gets a value that determines if this header is read only.
Methods
public
NameValueHeaderValue
Copy​()
Provides a copy of this object without the cost of re-validating the values.
Returns A copy.
public
NameValueHeaderValue
CopyAsReadOnly​()
Provides a copy of this instance while making it immutable.
Returns The readonly <see cref="T:Microsoft.Net.Http.Headers.NameValueHeaderValue" /> .
public
int
GetHashCode​()
public
bool
Equals​(object obj)
GetUnescapedValue​()
If the value is a quoted-string as defined by <see href="https://tools.ietf.org/html/rfc7230#section-3.2.6">the RFC specification</see> ,
removes quotes and unescapes backslashes and quotes.
Returns An unescaped version of <see cref="P:Microsoft.Net.Http.Headers.NameValueHeaderValue.Value" /> .
public
void
SetAndEscapeValue​(Extensions.​Primitives.​StringSegment value)
Sets <see cref="P:Microsoft.Net.Http.Headers.NameValueHeaderValue.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> .
public static
NameValueHeaderValue
Parse​(Extensions.​Primitives.​StringSegment input)
Parses <paramref name="input" /> as a <see cref="T:Microsoft.Net.Http.Headers.NameValueHeaderValue" /> value.
Returns The parsed values.
input
The values to parse.
public static
bool
TryParse​(Extensions.​Primitives.​StringSegment input,
NameValueHeaderValue& parsedValue)
public static
System.​Collections.​Generic.​IList<​NameValueHeaderValue>
ParseList​(System.​Collections.​Generic.​IList?<​string> input)
Parses a sequence of inputs as a sequence of <see cref="T:Microsoft.Net.Http.Headers.NameValueHeaderValue" /> values.
Returns The parsed values.
input
The values to parse.
public static
System.​Collections.​Generic.​IList<​NameValueHeaderValue>
ParseStrictList​(System.​Collections.​Generic.​IList?<​string> input)
Parses a sequence of inputs as a sequence of <see cref="T:Microsoft.Net.Http.Headers.NameValueHeaderValue" /> values using string parsing rules.
Returns The parsed values.
input
The values to parse.
public static
bool
TryParseList​(System.​Collections.​Generic.​IList?<​string> input,
System.​Collections.​Generic.​IList`1&? parsedValues)
public static
bool
TryParseStrictList​(System.​Collections.​Generic.​IList?<​string> input,
System.​Collections.​Generic.​IList`1&? parsedValues)
public
string
ToString​()
public static
NameValueHeaderValue
Find​(System.​Collections.​Generic.​IList?<​NameValueHeaderValue> values,
Extensions.​Primitives.​StringSegment name)
Finds a <see cref="T:Microsoft.Net.Http.Headers.NameValueHeaderValue" /> with the specified <paramref name="name" /> .
Returns The <see cref="T:Microsoft.Net.Http.Headers.NameValueHeaderValue" /> if found, otherwise <see langword="null" /> .
values
The collection to search.
name
The name to find.
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object