public sealed class WarningHeaderValueSegment
WarningHeaderValueSegment class with the specified warning code, agent, and text.public WarningHeaderValueSegment(string agent, string text, int code);
Parameters:
agent: The agent acting on behalf of the origin server. Typically a hostname or email address.
text: A human-readable description of the warning.
code: The warning code, which is an integer.
WarningHeaderValueSegment class by parsing a string representation of a warning segment.public WarningHeaderValueSegment(string segment);
Parameters:
segment: A string representing the warning header segment, e.g., "199 blackcat.example.com "This is a warning."".
FormatException if the provided string is not a valid warning segment.
public string Agent { get; }
public int Code { get; }
public string Text { get; }
WarningHeaderValueSegment to its string representation.public override string ToString();
Returns:
A string representing the warning header segment in the format "code agent text".
public static System.Collections.Generic.IList<WarningHeaderValueSegment> Parse(string value);
Parameters:
value: The string representation of the `Warning` header value.
Returns:
An IList<WarningHeaderValueSegment> containing the parsed segments.
public static bool TryParse(string value, [System.Runtime.InteropServices.OutAttribute] [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute](false)] out WarningHeaderValueSegment segment);
Parameters:
value: The string to parse.
segment: When this method returns, contains the parsed `WarningHeaderValueSegment` if the parse succeeded, or null if it failed.
Returns:
true if the string was parsed successfully; otherwise, false.
WarningHeaderValueSegment class encapsulates one of these individual warning notifications.
110: Response is stale111: Revalidation failed112: Disconnected operation199: Miscellaneous persistent warning214: Transformation applied