Skip to content

Commit

Permalink
Ensure POST bodies are logged as JSON.
Browse files Browse the repository at this point in the history
Fixes #143
  • Loading branch information
mcdee committed Jun 7, 2024
1 parent 23b592c commit 000ee97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s *Service) post(ctx context.Context, endpoint string, body io.Reader) (io
}
body = bytes.NewReader(bodyBytes)

e.Str("body", string(bodyBytes)).Msg("POST request")
e.RawJSON("body", bodyBytes).Msg("POST request")
}

callURL := urlForCall(s.base, endpoint, "")
Expand Down Expand Up @@ -127,7 +127,7 @@ func (s *Service) post2(ctx context.Context,
}
body = bytes.NewReader(bodyBytes)

e.Str("body", string(bodyBytes)).Msg("POST request")
e.RawJSON("body", bodyBytes).Msg("POST request")
default:
e.Str("content_type", contentType.String()).Msg("POST request")
}
Expand Down

0 comments on commit 000ee97

Please sign in to comment.