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

Method SetContentType

Ghttp/header.go:29–39  ·  view source on GitHub ↗

设置请求content type

(s string)

Source from the content-addressed store, hash-verified

27
28//设置请求content type
29func (h *Http) SetContentType(s string) *Http {
30 switch s {
31 case "form":
32 h.SetHeader("Content-Type", "application/x-www-form-urlencoded")
33 case "json":
34 h.SetHeader("Content-Type", "application/json;charset=UTF-8")
35 default:
36 h.SetHeader("Content-Type", s)
37 }
38 return h
39}

Callers 3

SetPostJsonMethod · 0.95
PostFunction · 0.80
BeianXCNMethod · 0.80

Calls 1

SetHeaderMethod · 0.95

Tested by

no test coverage detected