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

Method SetPostJson

Ghttp/post.go:37–48  ·  view source on GitHub ↗

json 格式的参数

(values map[string]interface{})

Source from the content-addressed store, hash-verified

35
36//json 格式的参数
37func (h *Http) SetPostJson(values map[string]interface{}) *Http {
38 bytesData, err := json.Marshal(values)
39 if err != nil {
40 log.Println("[!] SetPostJson Error: ", err)
41
42 }
43 h.HttpBody = bytes.NewReader(bytesData)
44 h.SetContentType("json")
45 h.setParams()
46 return h
47
48}
49
50// 字符串格式的参数 a=1&b=2
51func (h *Http) SetPostString(values string) *Http {

Callers 2

PostMethod · 0.95
LoginMethod · 0.80

Calls 2

SetContentTypeMethod · 0.95
setParamsMethod · 0.95

Tested by

no test coverage detected