自动更新
This commit is contained in:
parent
7f48d739b8
commit
8fa91ec335
@ -131,7 +131,7 @@ r.Body().Set("beginDate", "2022-03-01").Set("endDate", "2022-03-03")
|
||||
```
|
||||
|
||||
#### 字符串赋值
|
||||
通过此方法直接赋值json数据
|
||||
json格式不要使用此方法
|
||||
```go
|
||||
bodydata:=`{"devSn":"230000000008","type":"day"}`
|
||||
r.Body().SetString(bodydata)
|
||||
|
@ -210,8 +210,9 @@ func (s *SimpleRequest) initBody() {
|
||||
jsonData, err := json.Marshal(s.tempBody)
|
||||
if err == nil {
|
||||
s.body = bytes.NewReader(jsonData)
|
||||
} else {
|
||||
s.body = bytes.NewReader([]byte("{}"))
|
||||
}
|
||||
s.body = bytes.NewReader(jsonData)
|
||||
case contentTypeData == xmlDataType || contentTypeData == textPlainType || contentTypeData == javaScriptType:
|
||||
data, _ := s.tempBody[stringBodyType].(string)
|
||||
s.body = strings.NewReader(data)
|
||||
|
Loading…
Reference in New Issue
Block a user