private void Button_Click_2(object sender, RoutedEventArgs e) { testobject o = new testobject(); o.name = "超能物战队"; o.age = 12; var xx = NormalHttpClient.Post <testobject, string>("http://localhost:27215/api/Values?ak=1", o); }
private void Button_Click_1(object sender, RoutedEventArgs e) { testobject o = new testobject(); o.name = "超能物战队"; o.age = 12; //建议封装 var ss = Execute(o); }
private static ResponseInfo <string> Execute(testobject o) { //直接调用 return(SecurityHttpClient.Post <testobject, string>("http://localhost:27215/api/Values?ak=1", o)); }