Skip to content

Commit

Permalink
set content type if there is a request body
Browse files Browse the repository at this point in the history
  • Loading branch information
shaswot77 committed Apr 23, 2024
1 parent 36ec112 commit 31fbe68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/provider/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func (c *SquaredUpClient) doRequest(req *http.Request) ([]byte, error) {

req.Header.Add("User-Agent", fmt.Sprintf("SquaredUp-Terraform-Provider/%s", c.version))

if req.Body != nil {
req.Header.Add("Content-Type", "application/json")
}

res, err := c.httpClient.Do(req)
if err != nil {
return nil, err
Expand Down

0 comments on commit 31fbe68

Please sign in to comment.