go-httpaccept/README.md

24 lines
592 B
Markdown
Raw Permalink Normal View History

2023-08-11 23:45:11 +00:00
# go-httpaccess
Package **httpaccess** implements tools to deal with the HTTP "Accept" header.
## Documention
2023-08-11 23:59:14 +00:00
Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-httpaccess
2023-08-11 23:45:11 +00:00
2023-08-11 23:59:14 +00:00
[![GoDoc](https://godoc.org/sourcecode.social/reiver/go-httpaccess?status.svg)](https://godoc.org/sourcecode.social/reiver/go-httpaccess)
2023-08-11 23:45:11 +00:00
## Example
```go
//
2023-08-11 23:45:58 +00:00
values := httprequest.Header.Values("Accept")
2023-08-11 23:45:11 +00:00
// ...
accept, err := httpaccess.Parse(values...)
// ...
mediatype, err := accept.Negotiate("text/gemini", "text/html", "application/xhtml+xml")
```