func (k Key) ForMethod(method string) Key {
	k2 := k
	k2.method = method
	return k2
}
ForMethod returns a new Key with a given method
package httpcache
import (
	"bytes"
	"fmt"
	"net/http"
	"net/url"
	"strings"
)
type Key struct {
	method string
	header http.Header
	u      url.URL
	vary   []string
}
func NewKey(method string, u *url.URL, h http.Header) Key {
	return Key{method: method, header: h, u: *u, vary: []string{}}
}
func NewRequestKey(r *http.Request) Key {
	URL := r.URL
	if location := r.Header.Get("Content-Location"); location != "" {
		u, err := url.Parse(location)
		if err == nil {
			if !u.IsAbs() {
				u = r.URL.ResolveReference(u)
			}
			if u.Host != r.Host {
				debugf("illegal host %q in Content-Location", u.Host)
			} else {
				debugf("using Content-Location: %q", u.String())
				URL = u
			}
		} else {
			debugf("failed to parse Content-Location %q", location)
		}
	}
	return NewKey(r.Method, URL, r.Header)
}