logs fix
This commit is contained in:
@@ -20,11 +20,9 @@ func PostRequest(url string, model any, header http.Header, c echo.Context) ([]b
|
||||
req.Header = header
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
debug, err := json.Marshal(req)
|
||||
|
||||
if err != nil {
|
||||
c.Logger().Debug("Request---")
|
||||
c.Logger().Debug(string(debug))
|
||||
c.Logger().Debug(string(uJson))
|
||||
}
|
||||
|
||||
resp, err := client.Do(req)
|
||||
@@ -39,7 +37,7 @@ func PostRequest(url string, model any, header http.Header, c echo.Context) ([]b
|
||||
return nil, err, nil
|
||||
}
|
||||
|
||||
debug, err = json.Marshal(resp)
|
||||
debug, err := json.Marshal(resp.Body)
|
||||
|
||||
if err != nil {
|
||||
c.Logger().Debug("Response---")
|
||||
@@ -58,11 +56,9 @@ func GetRequest(url string, header http.Header, c echo.Context, args ...string)
|
||||
req.Header = header
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
debug, err := json.Marshal(req)
|
||||
|
||||
if err != nil {
|
||||
c.Logger().Debug("Request---")
|
||||
c.Logger().Debug(string(debug))
|
||||
c.Logger().Debug(req.URL.String())
|
||||
}
|
||||
|
||||
resp, err := client.Do(req)
|
||||
@@ -77,6 +73,8 @@ func GetRequest(url string, header http.Header, c echo.Context, args ...string)
|
||||
return nil, err, nil
|
||||
}
|
||||
|
||||
debug, err := json.Marshal(resp.Body)
|
||||
|
||||
if err != nil {
|
||||
c.Logger().Debug("Response---")
|
||||
c.Logger().Debug(string(debug))
|
||||
|
||||
Reference in New Issue
Block a user