Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
348f10413b
|
@ -3,7 +3,7 @@ package curl
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
|
@ -87,7 +87,7 @@ func (c *defaultClient) PostJson(jsonData interface{}, res interface{}) error {
|
|||
|
||||
//logc.Infof(c.ctx, "客户端 请求返回结果 Client PostForm res result:%+v", res)
|
||||
if resp.StatusCode() != 200 {
|
||||
err = errors.New("服务端失败")
|
||||
err = fmt.Errorf("服务端失败,返回结果:%+v", resp.RawResponse.Status)
|
||||
logx.Errorf("客户端 请求失败 Client PostForm Server error:%+v", err)
|
||||
}
|
||||
return err
|
||||
|
@ -111,7 +111,7 @@ func (c *defaultClient) PostForm(formData map[string]string, res interface{}) (i
|
|||
logc.Infof(c.ctx, "客户端 请求返回结果 Client PostForm RawResponse result:%+v,%+V", resp.RawResponse.Status, resp.RawResponse.StatusCode)
|
||||
logc.Infof(c.ctx, "客户端 请求返回结果 Client PostForm res result:%+v", res)
|
||||
if resp.StatusCode() != 200 {
|
||||
err = errors.New("服务端失败")
|
||||
err = fmt.Errorf("服务端失败,返回结果:%+v", resp.RawResponse.Status)
|
||||
logx.Errorf("客户端 请求失败 Client PostForm Server error:%+v", err)
|
||||
}
|
||||
return res, err
|
||||
|
@ -137,7 +137,7 @@ func (c *defaultClient) PostFile(fileParam string, fileName string, res interfac
|
|||
logc.Infof(c.ctx, "客户端 请求返回结果 Client PostFile RawResponse result:%+v,%+V", resp.RawResponse.Status, resp.RawResponse.StatusCode)
|
||||
logc.Infof(c.ctx, "客户端 请求返回结果 Client PostFile res result:%+v", res)
|
||||
if resp.StatusCode() != 200 {
|
||||
err = errors.New("服务端失败")
|
||||
err = fmt.Errorf("服务端失败,返回结果:%+v", resp.RawResponse.Status)
|
||||
logx.Errorf("客户端 请求失败 Client PostFile Server error:%+v", err)
|
||||
}
|
||||
return res, err
|
||||
|
|
Loading…
Reference in New Issue
Block a user