@@ -12,27 +12,25 @@ def __init__(self, jpush, zone = None):
1212 self .entity = None
1313 self .zone = zone or jpush .zone
1414
15- def send (self , method , url , body , content_type = None , version = 3 ):
15+ def send (self , method , url , body = None , content_type = None , version = 3 , params = None ):
1616 """Send the request
1717
1818 """
19- response = self ._jpush ._request (method , body , url , content_type , version = 3 )
19+ response = self ._jpush ._request (method , body , url , content_type , version = 3 , params = params )
2020 return DeviceResponse (response )
2121
2222 def get_taglist (self ):
2323 """Get deviceinfo with registration id.
2424 """
2525 url = common .get_url ('tag' , self .zone )
26- body = None
27- info = self .send ("GET" , url , body )
26+ info = self .send ("GET" , url )
2827 return info
2928
3029 def get_deviceinfo (self , registration_id ):
3130 """Get deviceinfo with registration id.
3231 """
3332 url = common .get_url ('device' , self .zone ) + registration_id
34- body = None
35- info = self .send ("GET" , url , body )
33+ info = self .send ("GET" , url )
3634 return info
3735
3836 def set_deviceinfo (self , registration_id , entity ):
@@ -55,10 +53,8 @@ def delete_tag(self, tag, platform=None):
5553 """Delete registration id tag.
5654 """
5755 url = common .get_url ('tag' , self .zone ) + tag
58- body = None
59- if platform :
60- body = platform
61- info = self .send ("DELETE" , url , body )
56+ params = { 'platform' : platform } if platform else None
57+ info = self .send ("DELETE" , url , params = params )
6258 return info
6359
6460 def update_tagusers (self , tag , entity ):
@@ -73,28 +69,23 @@ def check_taguserexist(self, tag, registration_id):
7369 """Check registration id whether in tag.
7470 """
7571 url = common .get_url ('tag' , self .zone ) + tag + "/registration_ids/" + registration_id
76- body = registration_id
77- info = self .send ("GET" , url , body )
72+ info = self .send ("GET" , url )
7873 return info
7974
8075 def delete_alias (self , alias , platform = None ):
8176 """Delete appkey alias.
8277 """
8378 url = common .get_url ('alias' , self .zone ) + alias
84- body = None
85- if platform :
86- body = platform
87- info = self .send ("DELETE" , url , body )
79+ params = { 'platform' : platform } if platform else None
80+ info = self .send ("DELETE" , url , params = params )
8881 return info
8982
9083 def get_aliasuser (self , alias , platform = None ):
9184 """Get appkey alias users.
9285 """
9386 url = common .get_url ('alias' , self .zone ) + alias
94- body = None
95- if platform :
96- body = platform
97- info = self .send ("GET" , url , body )
87+ params = { 'platform' : platform } if platform else None
88+ info = self .send ("GET" , url , params = params )
9889 return info
9990
10091
0 commit comments