goautoneg – github.com/munnerz/goautoneg Index | Files

package goautoneg

import "github.com/munnerz/goautoneg"

Index

Functions

func Negotiate

func Negotiate(header string, alternatives []string) (content_type string)

Negotiate the most appropriate content_type given the accept header and a list of alternatives.

func ParseAccept

func ParseAccept(header string) acceptSlice

Parse an Accept Header string returning a sorted list of clauses

Types

type Accept

type Accept struct {
	Type, SubType string
	Q             float64
	Params        map[string]string
}

Structure to represent a clause in an HTTP Accept Header

Source Files

autoneg.go

Version
v0.0.0-20191010083416-a7dc8b61c822 (latest)
Published
Oct 10, 2019
Platform
js/wasm
Imports
3 packages
Last checked
2 weeks ago

Tools for package owners.