@@ -64,14 +64,20 @@ def get_many(self, filters=None, action_id=None, **kwargs):
6464 def get (self , id = None , filters = None , action_id = None , ** kwargs ):
6565 return self ._get (id = id , filters = filters , action_id = action_id , ** kwargs )
6666
67- def create (self , data = None , filters = None , id = None , action_id = None , ** kwargs ):
67+ def create (self , data = None , filters = None , id = None , action_id = None , ensure_ascii = True , data_encoding = "utf-8" , ** kwargs ):
6868 if self .headers ['Content-type' ] == 'application/json' :
69- data = json .dumps (data )
69+ if ensure_ascii :
70+ data = json .dumps (data )
71+ else :
72+ data = json .dumps (data , ensure_ascii = False ).encode (data_encoding )
7073 return api_call (self ._auth , 'post' , self ._url , headers = self .headers , resource_id = id , data = data , action = self .action , action_id = action_id , filters = filters , ** kwargs )
7174
72- def update (self , id , data , filters = None , action_id = None , ** kwargs ):
75+ def update (self , id , data , filters = None , action_id = None , ensure_ascii = True , data_encoding = "utf-8" , ** kwargs ):
7376 if self .headers ['Content-type' ] == 'application/json' :
74- data = json .dumps (data )
77+ if ensure_ascii :
78+ data = json .dumps (data )
79+ else :
80+ data = json .dumps (data , ensure_ascii = False ).encode (data_encoding )
7581 return api_call (self ._auth , 'put' , self ._url , resource_id = id , headers = self .headers , data = data , action = self .action , action_id = action_id , filters = filters , ** kwargs )
7682
7783 def delete (self , id , ** kwargs ):
0 commit comments