HttpContentNegotiator<T>: ((this, request) => T | undefined | 0)

Type Parameters

  • T

    A type of the matching value.

Type declaration

    • (this, request): T | undefined | 0
    • HTTP content negotiator signature.

      Extracts a value matching the given HTTP content negotiation request.

      This is used to process request headers like Accept, Accept-Encoding, Accept-Language, etc.

      The content negotiator can be constructed by httpContentNegotiator function.

      Parameters

      • this: void
      • request: string | Iterable<HthvItem>

        Content negotiation request. This an Accept... header value, either parsed, or as a raw string.

      Returns T | undefined | 0

      The best matching value, undefined if there is no matching value, or 0 is the matching value is explicitly prohibited (i.e. ;q=0 is used in matching request item).

Generated using TypeDoc