mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-18 09:40:36 +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 {
|
if err != nil {
|
||||||
return nil, "", err
|
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)
|
err = json.NewEncoder(r).Encode(x)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
|
|||||||
Reference in New Issue
Block a user