getOptionalHeaderFieldAsURI(in:name:as:)

    Attempts to retrieve an optional header field value and decodes it as a URI component, returning it as the specified type.

    Converter+Common.swift:135

    This declaration is gated by at least one @_spi attribute.

    func getOptionalHeaderFieldAsURI<T>(in headerFields: HTTPFields, name: String, as type: T.Type) throws -> T? where T : Decodable

    Parameters

    headerFields

    The HTTP header fields dictionary where the field is expected.

    name

    The name of the header field to retrieve.

    type

    The expected type of the decoded value.

    Returns

    The decoded header field value as the specified type, or nil if the field is not present.

    Throws

    An error if there’s an issue with decoding the URI component or if the field is present but cannot be decoded as the specified type.

    Other members in extension

    Type members

    Show system interfaces (1)

    Hide system interfaces

    Instance members

    Show system interfaces (44)

    Hide system interfaces