1 /// <summary> 2 ///php写的后台接口传递数组参数时需要单独处理,不能直接用List<object> 3 /// UrlEncoded 数组参数的传递 4 /// </summary> 5 /// <returns></returns> 6 async Task SendArraryDemo() 7 { 8 string url = ""; 9 // post 10 await url.PostUrlEncodedAsync(new Dictionary<string, object> 11 { 12 ["array[]"] = new[] { 1, 2, 3, 4 },//传递整数数组 13 ["other"] = "other paramter" 14 }); 15 16 //send 17 await url.SendUrlEncodedAsync(HttpMethod.Post, 18 // HttpMethod.Delete || HttpMethod.Put || 19 new Dictionary<string, object> 20 { 21 ["array[]"] = new[] { 1, 2, 3, 4 },//传递整数数组 22 ["other"] = "other paramter" 23 }); 24 25 } 26