0
我有一個WindowsForm應用程序,我想一個列表<>發送到Web APIC#通過HttpClient的發送對象到Web API
這裏是我在Windows窗體應用程序代碼:
Uri uri = new Uri("http://localhost/test/api/v1/name/testcontroller/");
HttpClient client = new HttpClient();
client.BaseAddress = uri;
var mediaType = new MediaTypeHeaderValue("application/json");
var jsonFormatter = new JsonMediaTypeFormatter();
HttpContent content = new ObjectContent<List<TermbaseFile>>(termbaseList, jsonFormatter);
HttpResponseMessage responseMessage = client.PostAsync(uri, content).Result;
我應該在控制器方法中放置什麼?
你有什麼試過的?首先嚐試的是'List>'。 –
2013-03-21 10:46:09