Skip to content

Commit 3774cab

Browse files
authored
Merge pull request #57 from squaredup/work/ss/update-query-api
Update Query to New Graph Query Endpoint
2 parents e8134cf + 31fbe68 commit 3774cab

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

internal/provider/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func (c *SquaredUpClient) doRequest(req *http.Request) ([]byte, error) {
6161

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

64+
if req.Body != nil {
65+
req.Header.Add("Content-Type", "application/json")
66+
}
67+
6468
res, err := c.httpClient.Do(req)
6569
if err != nil {
6670
return nil, err

internal/provider/client_node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (c *SquaredUpClient) GetNodes(dataSourceId string, nodeName string, nodeSou
3838
return nil, err
3939
}
4040

41-
req, err := http.NewRequest("POST", c.baseURL+"/api/query", strings.NewReader(string(reqBody)))
41+
req, err := http.NewRequest("POST", c.baseURL+"/api/graph/query", strings.NewReader(string(reqBody)))
4242
if err != nil {
4343
return nil, err
4444
}

0 commit comments

Comments
 (0)