Skip to content

Commit

Permalink
Set request content type
Browse files Browse the repository at this point in the history
  • Loading branch information
ckaznocha committed Dec 6, 2023
1 parent f78dfda commit 43c6c07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/flaghttp/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func (r *request) do(method, url string) (Response, error) {
req.Header[k] = v
}

if r.body != nil {
req.Header.Set("Content-Type", "application/json")
}

res, err := client.Do(req)
if err != nil {
if r.client.retryCount > 0 && r.retryCount < r.client.retryCount {
Expand Down

0 comments on commit 43c6c07

Please sign in to comment.