Skip to content

Commit 3d013c4

Browse files
Update client.py
1 parent ff6cd64 commit 3d013c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

splunklib/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,7 +3619,7 @@ def __init__(self, collection):
36193619
self.service = collection.service
36203620
self.collection = collection
36213621
self.owner, self.app, self.sharing = collection._proper_namespace()
3622-
self.path = 'storage/collections/data/' + UrlEncoded(self.collection.name) + '/'
3622+
self.path = 'storage/collections/data/' + UrlEncoded(self.collection.name, encode_slash=True) + '/'
36233623

36243624
def _get(self, url, **kwargs):
36253625
return self.service.get(self.path + url, owner=self.owner, app=self.app, sharing=self.sharing, **kwargs)
@@ -3652,7 +3652,7 @@ def query_by_id(self, id):
36523652
:return: Document with id
36533653
:rtype: ``dict``
36543654
"""
3655-
return json.loads(self._get(UrlEncoded(str(id))).body.read().decode('utf-8'))
3655+
return json.loads(self._get(UrlEncoded(str(id), encode_slash=True)).body.read().decode('utf-8'))
36563656

36573657
def insert(self, data):
36583658
"""
@@ -3686,7 +3686,7 @@ def delete_by_id(self, id):
36863686
36873687
:return: Result of DELETE request
36883688
"""
3689-
return self._delete(UrlEncoded(str(id)))
3689+
return self._delete(UrlEncoded(str(id), encode_slash=True))
36903690

36913691
def update(self, id, data):
36923692
"""
@@ -3700,7 +3700,7 @@ def update(self, id, data):
37003700
:return: id of replaced document
37013701
:rtype: ``dict``
37023702
"""
3703-
return json.loads(self._post(UrlEncoded(str(id)), headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))
3703+
return json.loads(self._post(UrlEncoded(str(id), encode_slash=True), headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))
37043704

37053705
def batch_find(self, *dbqueries):
37063706
"""

0 commit comments

Comments
 (0)