Skip to content

Commit 19d59c6

Browse files
committed
reduced number of api calls
1 parent e7a631a commit 19d59c6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

splunklib/binding.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -821,20 +821,21 @@ def request(self, path_segment, method="GET", headers=None, body={},
821821

822822
if body:
823823
body = _encode(**body)
824+
824825
if method == "GET":
825826
path = path + UrlEncoded('?' + body, skip_encode=True)
826-
response = self.http.request(path,
827-
{'method': method,
828-
'headers': all_headers})
827+
message = {'method': method,
828+
'headers': all_headers}
829829
else:
830-
response = self.http.request(path,
831-
{'method': method,
832-
'headers': all_headers,
833-
'body': body})
830+
message = {'method': method,
831+
'headers': all_headers,
832+
'body': body}
834833
else:
835-
response = self.http.request(path,
836-
{'method': method,
837-
'headers': all_headers})
834+
message = {'method': method,
835+
'headers': all_headers}
836+
837+
response = self.http.request(path, message)
838+
838839
return response
839840

840841
def login(self):

0 commit comments

Comments
 (0)