完成client的构建

This commit is contained in:
2024-05-31 18:00:24 +08:00
parent 2be9c90b79
commit a0adefcc0c
7 changed files with 77 additions and 10 deletions

View File

@ -38,6 +38,15 @@ type requestConfig struct {
//
// Date : 16:25 2024/5/31
func (rc *requestConfig) initDefaultConfig(reqConfig *define.Request) {
if nil == reqConfig.Header {
reqConfig.Header = map[string]string{}
}
if len(reqConfig.ContentType) > 0 {
reqConfig.Header["Content-Type"] = reqConfig.ContentType
}
if nil == reqConfig.Cookie {
reqConfig.Cookie = map[string]string{}
}
if reqConfig.ConnectTimeout <= 0 {
reqConfig.ConnectTimeout = define.DefaultConnectTimeout
}