Skip to content

Commit

Permalink
add request logging to API
Browse files Browse the repository at this point in the history
to investigate errors returned
  • Loading branch information
drypa committed Feb 11, 2024
1 parent 0b5c0af commit eef0bdf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/nalogru/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"io"
"log"
"net/http"
"net/http/httputil"
"os"
"receipt_collector/dispose"
"receipt_collector/nalogru/device"
Expand Down Expand Up @@ -393,6 +394,13 @@ func (nalogruClient *Client) VerifyPhone(device *device.Device, code string) err
}

func sendRequest(request *http.Request, client *http.Client) (*http.Response, error) {
dump, err := httputil.DumpRequestOut(request, true)
if err != nil {
log.Fatal(err)
}

fmt.Printf("%q", dump)

return client.Do(request)
}

Expand Down

0 comments on commit eef0bdf

Please sign in to comment.