net/http.Request.Header (field)
95 uses
net/http (current package)
client.go#L242: if req.Header == nil {
client.go#L244: req.Header = make(Header)
client.go#L247: if u := req.URL.User; u != nil && req.Header.Get("Authorization") == "" {
client.go#L251: req.Header = cloneOrMakeHeader(ireq.Header)
client.go#L252: req.Header.Set("Authorization", "Basic "+basicAuth(username, password))
client.go#L665: Header: make(Header),
client.go#L687: if ref := refererForURL(reqs[len(reqs)-1].URL, req.URL, req.Header.Get("Referer")); ref != "" {
client.go#L688: req.Header.Set("Referer", ref)
client.go#L753: ireqhdr = cloneOrMakeHeader(ireq.Header)
client.go#L756: if c.Jar != nil && ireq.Header.Get("Cookie") != "" {
client.go#L802: req.Header[k] = vv
client.go#L856: req.Header.Set("Content-Type", contentType)
fs.go#L408: im := r.Header.Get("If-Match")
fs.go#L438: ius := r.Header.Get("If-Unmodified-Since")
fs.go#L457: inm := r.Header.get("If-None-Match")
fs.go#L490: ims := r.Header.Get("If-Modified-Since")
fs.go#L511: ir := r.Header.get("If-Range")
fs.go#L595: rangeHeader = r.Header.get("Range")
h2_bundle.go#L5832: } else if err := http2checkValidHTTP2RequestHeaders(req.Header); err != nil {
h2_bundle.go#L6086: Header: rp.header,
h2_bundle.go#L8265: if v := req.Header.Get("Upgrade"); v != "" {
h2_bundle.go#L8266: return fmt.Errorf("http2: invalid Upgrade request header: %q", req.Header["Upgrade"])
h2_bundle.go#L8268: if vv := req.Header["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") {
h2_bundle.go#L8271: if vv := req.Header["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !http2asciiEqualFold(vv[0], "close") && !http2asciiEqualFold(vv[0], "keep-alive")) {
h2_bundle.go#L8462: req.Header.Get("Accept-Encoding") == "" &&
h2_bundle.go#L8463: req.Header.Get("Range") == "" &&
h2_bundle.go#L8482: if !httpguts.HeaderValuesContainsToken(req.Header["Expect"], "100-continue") {
h2_bundle.go#L8982: for k, vv := range req.Header {
h2_bundle.go#L9015: for k, vv := range req.Header {
h2_bundle.go#L10181: return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close")
request.go#L174: Header Header
request.go#L385: if r.Header != nil {
request.go#L386: r2.Header = r.Header.Clone()
request.go#L411: return r.Header.Get("User-Agent")
request.go#L416: return readCookies(r.Header, "")
request.go#L430: for _, c := range readCookies(r.Header, name) {
request.go#L444: if c := r.Header.Get("Cookie"); c != "" {
request.go#L445: r.Header.Set("Cookie", c+"; "+s)
request.go#L447: r.Header.Set("Cookie", s)
request.go#L460: return r.Header.Get("Referer")
request.go#L487: v := r.Header.Get("Content-Type")
request.go#L508: return r.Method == "PRI" && len(r.Header) == 0 && r.URL.Path == "*" && r.Proto == "HTTP/2.0"
request.go#L668: if r.Header.has("User-Agent") {
request.go#L669: userAgent = r.Header.Get("User-Agent")
request.go#L691: err = r.Header.writeSubset(w, reqWriteExcludeHeader, trace)
request.go#L894: Header: make(Header),
request.go#L949: auth := r.Header.Get("Authorization")
request.go#L988: r.Header.Set("Authorization", "Basic "+basicAuth(username, password))
request.go#L1029: delete(req.Header, "Host")
request.go#L1091: req.Header = Header(mimeHeader)
request.go#L1092: if len(req.Header["Host"]) > 1 {
request.go#L1105: req.Host = req.Header.get("Host")
request.go#L1108: fixPragmaCacheControl(req.Header)
request.go#L1110: req.Close = shouldClose(req.ProtoMajor, req.ProtoMinor, req.Header, false)
request.go#L1222: ct := r.Header.Get("Content-Type")
request.go#L1416: return hasToken(r.Header.get("Expect"), "100-continue")
request.go#L1423: return hasToken(r.Header.get("Connection"), "keep-alive")
request.go#L1430: return hasToken(r.Header.get("Connection"), "close")
request.go#L1449: if r.Header.has("Idempotency-Key") || r.Header.has("X-Idempotency-Key") {
request.go#L1486: return hasToken(r.Header.Get("Connection"), "upgrade") &&
request.go#L1487: ascii.EqualFold(r.Header.Get("Upgrade"), "websocket")
server.go#L1014: hosts, haveHost := req.Header["Host"]
server.go#L1022: for k, vv := range req.Header {
server.go#L1032: delete(req.Header, "Host")
server.go#L1988: } else if req.Header.get("Expect") != "" {
transfer.go#L89: t.Header = rr.Header
transfer.go#L503: t.Header = rr.Header
transport.go#L522: if req.Header == nil {
transport.go#L529: for k, vv := range req.Header {
transport.go#L1694: Header: hdr,
transport.go#L2587: req.Header.Get("Accept-Encoding") == "" &&
transport.go#L2588: req.Header.Get("Range") == "" &&
transport.go#L2613: !isProtocolSwitchHeader(req.Header) {
go.uber.org/zap
http_handler.go#L93: requestedLvl, err := decodePutRequest(r.Header.Get("Content-Type"), r)
nhooyr.io/websocket
accept.go#L118: key := r.Header.Get("Sec-WebSocket-Key")
accept.go#L126: copts, ok := selectDeflate(websocketExtensions(r.Header), opts.CompressionMode)
accept.go#L167: if !headerContainsTokenIgnoreCase(r.Header, "Connection", "Upgrade") {
accept.go#L170: return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: Connection header %q does not contain Upgrade", r.Header.Get("Connection"))
accept.go#L173: if !headerContainsTokenIgnoreCase(r.Header, "Upgrade", "websocket") {
accept.go#L176: return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: Upgrade header %q does not contain websocket", r.Header.Get("Upgrade"))
accept.go#L183: if r.Header.Get("Sec-WebSocket-Version") != "13" {
accept.go#L185: return http.StatusBadRequest, fmt.Errorf("unsupported WebSocket protocol version (only 13 is supported): %q", r.Header.Get("Sec-WebSocket-Version"))
accept.go#L188: websocketSecKeys := r.Header.Values("Sec-WebSocket-Key")
accept.go#L207: origin := r.Header.Get("Origin")
accept.go#L241: cps := headerTokens(r.Header, "Sec-WebSocket-Protocol")
dial.go#L194: req.Header = opts.HTTPHeader.Clone()
dial.go#L195: req.Header.Set("Connection", "Upgrade")
dial.go#L196: req.Header.Set("Upgrade", "websocket")
dial.go#L197: req.Header.Set("Sec-WebSocket-Version", "13")
dial.go#L198: req.Header.Set("Sec-WebSocket-Key", secWebSocketKey)
dial.go#L200: req.Header.Set("Sec-WebSocket-Protocol", strings.Join(opts.Subprotocols, ","))
dial.go#L203: req.Header.Set("Sec-WebSocket-Extensions", copts.String())
|
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |