Skip to content

Commit

Permalink
Set content type header when payload is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
aziemski committed Aug 18, 2020
1 parent 9a0798f commit 53927c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func newRequest(method string, url string, data []byte) (*http.Request, error) {
if err != nil {
return nil, err
}
if data != nil {
request.Header.Add("Content-Type", jsonContentType)
}
request.Header.Add("Accept", jsonContentType)

return request, nil
Expand Down

0 comments on commit 53927c5

Please sign in to comment.