package header
import "github.com/golang/gddo/httputil/header"
Package header provides functions for parsing HTTP headers.
Index ¶
- func Copy(header http.Header) http.Header
- func ParseList(header http.Header, key string) []string
- func ParseTime(header http.Header, key string) time.Time
- func ParseValueAndParams(header http.Header, key string) (value string, params map[string]string)
- type AcceptSpec
Functions ¶
func Copy ¶
Copy returns a shallow copy of the header.
func ParseList ¶
ParseList parses a comma separated list of values. Commas are ignored in quoted strings. Quoted values are not unescaped or unquoted. Whitespace is trimmed.
func ParseTime ¶
ParseTime parses the header as time. The zero value is returned if the header is not present or there is an error parsing the header.
func ParseValueAndParams ¶
ParseValueAndParams parses a comma separated list of values with optional semicolon separated name-value pairs. Content-Type and Content-Disposition headers are in this format.
Types ¶
type AcceptSpec ¶
AcceptSpec describes an Accept* header.
func ParseAccept ¶
func ParseAccept(header http.Header, key string) (specs []AcceptSpec)
ParseAccept parses Accept* headers.
Source Files ¶
- Version
- v0.0.0-20210115222349-20d68f94ee1f (latest)
- Published
- Jan 15, 2021
- Platform
- windows/amd64
- Imports
- 3 packages
- Last checked
- 2 hours ago –
Tools for package owners.