修改www-form-urlencoded不传值的bug

This commit is contained in:
徐俊杰 2022-05-09 17:22:04 +08:00
parent 278ee73d9f
commit 6e02506135

View File

@ -258,7 +258,7 @@ func (s *SimpleRequest) initBody() {
case contentTypeData == "" || strings.Contains(contentTypeData, "form-urlencoded"):
//默认为x-www-form-urlencoded格式
tmpData := url.Values{}
for k, v := range tmpData {
for k, v := range s.tempBody {
tmpData.Set(k, fmt.Sprintf("%v", v))
}
s.body = strings.NewReader(tmpData.Encode())