diff --git a/Storage/Storage/LCCloud.cs b/Storage/Storage/LCCloud.cs index 830c8e0..8080aab 100644 --- a/Storage/Storage/LCCloud.cs +++ b/Storage/Storage/LCCloud.cs @@ -13,15 +13,20 @@ namespace LeanCloud.Storage { /// /// /// - public static async Task> Run(string name, Dictionary parameters = null) { + public static async Task> Run(string name, + Dictionary parameters = null) { string path = $"functions/{name}"; - Dictionary response = await LCApplication.HttpClient.Post>(path, data: parameters); + object encodeParams = LCEncoder.Encode(parameters); + Dictionary response = await LCApplication.HttpClient.Post>(path, + data: encodeParams); return response; } - public static async Task RPC(string name, Dictionary parameters = null) { + public static async Task RPC(string name, object parameters = null) { string path = $"call/{name}"; - Dictionary response = await LCApplication.HttpClient.Post>(path, data: parameters); + object encodeParams = LCEncoder.Encode(parameters); + Dictionary response = await LCApplication.HttpClient.Post>(path, + data: encodeParams); return LCDecoder.Decode(response["result"]); } }