Skip to content

Commit 39fb7db

Browse files
federicolanusse-DBandrewmchen
authored andcommitted
Use query parameters for GET calls to API (#213)
Use query parameters for GET calls to API
1 parent 34b1749 commit 39fb7db

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

databricks_cli/sdk/api_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ def perform_query(self, method, path, data = {}, headers = None):
110110

111111
with warnings.catch_warnings():
112112
warnings.simplefilter("ignore", exceptions.InsecureRequestWarning)
113-
resp = self.session.request(method, self.url + path, data = json.dumps(data),
114-
verify = self.verify, headers = headers)
113+
if method == 'GET':
114+
resp = self.session.request(method, self.url + path, params = data,
115+
verify = self.verify, headers = headers)
116+
else:
117+
resp = self.session.request(method, self.url + path, data = json.dumps(data),
118+
verify = self.verify, headers = headers)
115119
try:
116120
resp.raise_for_status()
117121
except requests.exceptions.HTTPError as e:

0 commit comments

Comments
 (0)