Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Sep 25, 2024
1 parent 4c3a186 commit 806f3f2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ func httpReq(url string, payload []byte) jsonResponse {
logrus.Debug(url)
logrus.Debugf("Request: [%s]", string(payload))

request, error := http.NewRequest("POST", url, bytes.NewBuffer(payload))
request, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
if err != nil {
logrus.Fatal(err)
}
request.Header.Set("Content-Type", "application/json; charset=UTF-8")
response, error := client.Do(request)
if error != nil {
logrus.Fatal(error)
response, err := client.Do(request)
if err != nil {
logrus.Fatal(err)
}
body, _ := io.ReadAll(response.Body)
logrus.Debugf("Response: [%s]", string(body))
Expand Down

0 comments on commit 806f3f2

Please sign in to comment.