negotiate

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2018 License: MIT Imports: 5 Imported by: 0

README

negotiate GoDoc Build Status Coverage Status

Negotiate is a simple HTTP content type negotiation package. Since its core dependency doesn't tag releases, it checks in vendor/ and doesn't leak any vendored types.

Installation

go get -u github.com/akshayjshah/vendor

Current Status

Stable. Once https://github.com/golang/go/issues/19307 is resolved, I'll stop maintaining this package.

Documentation

Overview

Package negotiate provides a function for HTTP content type negotiation.

Once https://github.com/golang/go/issues/19307 is resolved, this package will no longer be maintained.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType

func ContentType(r *http.Request, offers []string) (string, error)

ContentType returns the best offered content type for the request's Accept header. Offers must include both a MIME type and subtype, e.g. text/plain or image/png. If two offers match with equal weight and specificity, then the offer earlier in the list is preferred. If no offers match, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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