Documentation
¶
Overview ¶
Package negotiate provides HTTP content negotiation utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Accept ¶
Accept returns the best matching offer based on the Accept header value. Returns "" if no offer matches.
func MatchMedia ¶
MatchMedia returns true if the Accept pattern matches the offered media type. Supports wildcards: "*/*" matches everything, "text/*" matches any text subtype.
Types ¶
type AcceptItem ¶
AcceptItem represents a parsed Accept header entry with media type and quality.
func Parse ¶
func Parse(header string) []AcceptItem
Parse parses an Accept header value into a slice of AcceptItems.
Click to show internal directories.
Click to hide internal directories.