func ContentCharset(charsets ...string) http.HandlerFunc {
	for i, c := range charsets {
		charsets[i] = strings.ToLower(c)
	}
	return func(w http.ResponseWriter, r *http.Request) {
		if contentMethod(r.Method) && !checkCC(r.Header.Get("Content-Type"), charsets...) {
			w.WriteHeader(http.StatusUnsupportedMediaType)
		}
	}
}
ContentCharset generates a handler that writes a 415 Unsupported Media Type response if none of the charsets match.
An empty charset will allow requests with no Content-Type header or no specified charset.
package strict
import (
	"net/http"
	"strconv"
	"strings"
	"github.com/go-martini/martini"
)
const StatusUnprocessableEntity = 422
type Negotiator interface {
	Accepts(string) float64
	ContentType(...string) bool
}
type negotiator struct {
	r *http.Request
}
func (n *negotiator) Accepts(ctype string) float64 {
	return accepts(n.r.Header.Get("Accept"), ctype)
}
func (n *negotiator) ContentType(ctypes ...string) bool {
	return checkCT(n.r.Header.Get("Content-Type"), ctypes...)
}
func Strict(r *http.Request, c martini.Context) {
	c.MapTo(&negotiator{r}, (*Negotiator)(nil))
}
func ContentType(ctypes ...string) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		if contentMethod(r.Method) && !checkCT(r.Header.Get("Content-Type"), ctypes...) {
			w.WriteHeader(http.StatusUnsupportedMediaType)
		}
	}
}