This commit is contained in:
kandrusyak
2023-09-25 22:12:59 +03:00
parent 569d5ff7ed
commit 02ae90eb52

View File

@@ -20,11 +20,9 @@ func PostRequest(url string, model any, header http.Header, c echo.Context) ([]b
req.Header = header req.Header = header
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
debug, err := json.Marshal(req)
if err != nil { if err != nil {
c.Logger().Debug("Request---") c.Logger().Debug("Request---")
c.Logger().Debug(string(debug)) c.Logger().Debug(string(uJson))
} }
resp, err := client.Do(req) 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 return nil, err, nil
} }
debug, err = json.Marshal(resp) debug, err := json.Marshal(resp.Body)
if err != nil { if err != nil {
c.Logger().Debug("Response---") 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 = header
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
debug, err := json.Marshal(req)
if err != nil { if err != nil {
c.Logger().Debug("Request---") c.Logger().Debug("Request---")
c.Logger().Debug(string(debug)) c.Logger().Debug(req.URL.String())
} }
resp, err := client.Do(req) 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 return nil, err, nil
} }
debug, err := json.Marshal(resp.Body)
if err != nil { if err != nil {
c.Logger().Debug("Response---") c.Logger().Debug("Response---")
c.Logger().Debug(string(debug)) c.Logger().Debug(string(debug))