MCPcopy Index your code
hub / github.com/code-scan/Goal / SetHeader

Method SetHeader

Ghttp/header.go:7–23  ·  view source on GitHub ↗
(key string, value string)

Source from the content-addressed store, hash-verified

5)
6
7func (h *Http) SetHeader(key string, value string) *Http {
8 defer func() {
9 if err := recover(); err != nil {
10 log.Println(err)
11 }
12 }()
13 if h.HttpRequest == nil {
14 log.Println("[!]HttpRequest Is not Init")
15 return h
16 }
17 if head := h.HttpRequest.Header.Get(key); head != "" {
18 h.HttpRequest.Header.Set(key, value)
19 } else {
20 h.HttpRequest.Header.Add(key, value)
21 }
22 return h
23}
24func (h *Http) SetUserAgent(agent string) {
25 h.SetHeader("User-Agent", agent)
26}

Callers 12

SetUserAgentMethod · 0.95
SetContentTypeMethod · 0.95
SetCookieMethod · 0.95
IPinfoFunction · 0.95
GetFunction · 0.80
PostFunction · 0.80
sendMethod · 0.80
GetBuildIdMethod · 0.80
sendMethod · 0.80
GetBuildIdMethod · 0.80
httpReqMethod · 0.80
getMethod · 0.80

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected