Registry / networking / munnerz-goautoneg

munnerz-goautoneg

JSON →
library0.0.0-20191010083416-a7dc8b61c822gogounverified

Implements HTTP content negotiation using the Accept header, enabling server-driven content type selection.

go get github.com/munnerz/goautoneg
INSTALL
IMPORT
SIG · MUNNERZ-GOAUTONEG
M
munnerz-goautoneg
networkinggov0.0.0-20191010083416-a7dc8b61c822
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

goautoneg
github.com/munnerz/goautoneg

Negotiates the best content type from an Accept header.

package main import ( "fmt" "github.com/munnerz/goautoneg" ) func main() { accept := "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" alternatives := []string{"text/html", "application/json"} chosen := goautoneg.Negotiate(accept, alternatives) fmt.Println(chosen) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20191010083416-a7dc8b61c822latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
munnerz-goautoneg — go get munnerz-goautoneg · libregistry