HeaderUtilities Class

Definition

Provides utilities to parse and modify HTTP header values.

public ref class HeaderUtilities abstract sealed
public static class HeaderUtilities
type HeaderUtilities = class
Public Class HeaderUtilities
Inheritance
HeaderUtilities

Methods

ContainsCacheDirective(StringValues, String)

Check if a target directive exists among the set of given cache control directives.

EscapeAsQuotedString(StringSegment)

Escapes a StringSegment as a quoted-string, which is defined by the RFC specification.

FormatDate(DateTimeOffset, Boolean)

Formats the dateTime using the RFC1123 format specifier and optionally quotes it.

FormatDate(DateTimeOffset)

Formats the dateTime using the RFC1123 format specifier.

FormatInt64(Int64)
FormatNonNegativeInt64(Int64)

Converts the non-negative 64-bit numeric value to its equivalent string representation.

IsQuoted(StringSegment)

Determines if the specified input is quoted.

RemoveQuotes(String)
RemoveQuotes(StringSegment)

Removes quotes from the specified input if quoted.

TryParseDate(String, DateTimeOffset)
TryParseDate(StringSegment, DateTimeOffset)

Attempts to parse the specified input as a DateTimeOffset value.

TryParseInt64(String, Int64)
TryParseNonNegativeInt32(StringSegment, Int32)

Try to convert a string representation of a positive number to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.

TryParseNonNegativeInt64(StringSegment, Int64)

Try to convert a StringSegment representation of a positive number to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.

TryParseSeconds(StringValues, String, Nullable<TimeSpan>)

Try to find a target header value among the set of given header values and parse it as a TimeSpan.

UnescapeAsQuotedString(StringSegment)

Given a quoted-string as defined by the RFC specification, removes quotes and unescapes backslashes and quotes. This assumes that the input is a valid quoted-string.

Applies to