支持自适应请求类型, 根据不同请求类型设置正确Body格式

This commit is contained in:
2025-05-08 15:12:37 +08:00
parent 1abe6c1c29
commit 1403693fda
9 changed files with 203 additions and 30 deletions

View File

@ -0,0 +1,21 @@
// Package request ...
//
// Description : request ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2025-05-08 14:21
package request
import (
"resty.dev/v3"
)
// WriteJson application/json写入
type WriteJson struct {
}
func (w *WriteJson) Write(request *resty.Request, bodyData map[string]any) error {
request.SetBody(bodyData)
return nil
}