Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchAcceptStrict ¶
MatchAcceptStrict returns the best matching offer explicitly listed in the request's Accept header, ignoring wildcard media ranges ("*/*" and "type/*").
Only exact media-type matches are considered. Entries with q=0 are ignored. If multiple offers match, the one with the highest q-value is selected. If q-values tie, the offer that appears earlier in the offers slice wins.
MatchAcceptStrict returns "" if the Accept header is not present or no explicit match is found.
func Negotiate ¶
Negotiate returns the best offered content type for the request's Accept header. If two offers match with equal weight, then the more specific offer is preferred. For example, text/* trumps */*. If two offers match with equal weight and specificity, then the offer earlier in the list is preferred. If no offers match, then defaultOffer is returned.
Types ¶
This section is empty.