You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simpleRequest/body.go

32 lines
591 B
Go

3 years ago
/*
* @FileName: body.go
* @Author: JuneXu
* @CreateTime: 2022/3/2 1:23
* @Description:
*/
package simpleRequest
var (
stringBodyType = "__STRING_BODY__"
)
type BodyConf struct {
simpleReq *SimpleRequest
}
func (s *BodyConf) Set(key string, value interface{}) *BodyConf {
s.simpleReq.tempBody[key] = value
return s
}
func (s *BodyConf) Sets(data map[string]interface{}) *BodyConf {
for k, v := range data {
s.simpleReq.tempBody[k] = v
}
return s
}
func (s *BodyConf) SetString(strData string) *BodyConf {
s.simpleReq.tempBody[stringBodyType] = strData
return s
}