This commit is contained in:
kandrusyak
2023-09-25 22:17:14 +03:00
parent 02ae90eb52
commit 7d3c4a26fe

View File

@@ -20,10 +20,8 @@ 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")
if err != nil {
c.Logger().Debug("Request---") c.Logger().Debug("Request---")
c.Logger().Debug(string(uJson)) 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
debug, err := json.Marshal(resp.Body) 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))
} }
@@ -56,10 +54,8 @@ 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")
if err != nil {
c.Logger().Debug("Request---") c.Logger().Debug("Request---")
c.Logger().Debug(req.URL.String()) c.Logger().Debug(req.URL.String())
}
resp, err := client.Do(req) resp, err := client.Do(req)
@@ -75,7 +71,7 @@ func GetRequest(url string, header http.Header, c echo.Context, args ...string)
debug, err := json.Marshal(resp.Body) 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))
} }