Skip to content

Commit 53927c5

Browse files
committed
Set content type header when payload is provided
1 parent 9a0798f commit 53927c5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

remote.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ func newRequest(method string, url string, data []byte) (*http.Request, error) {
6767
if err != nil {
6868
return nil, err
6969
}
70+
if data != nil {
71+
request.Header.Add("Content-Type", jsonContentType)
72+
}
7073
request.Header.Add("Accept", jsonContentType)
7174

7275
return request, nil

0 commit comments

Comments
 (0)