goautoneg

package
v1.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

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

func ParseAccept

func ParseAccept(header string) (accept []Accept)

Parse an Accept Header string returning a sorted list of clauses

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL