mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-17 09:00:31 +08:00
fix multipart
This commit is contained in:
2
http.go
2
http.go
@@ -120,7 +120,7 @@ func WriteBodyByMultipartFormData(params ...any) (*bytes.Buffer, string, error)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
if rx.Elem().Kind() == reflect.Struct { // 使用 json 编码
|
||||
if rx.Kind() == reflect.Pointer && rx.Elem().Kind() == reflect.Struct { // 使用 json 编码
|
||||
err = json.NewEncoder(r).Encode(x)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
|
||||
Reference in New Issue
Block a user