我正在尝试在提琴手上监视来自 VS2012 的以下请求,但不能:
var client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:8081/");
var product = new Product() { Description = "blabla", CatalogName = "myName"};
MediaTypeFormatter jsonFormatter = new JsonMediaTypeFormatter();
// Use the JSON formatter to create the content of the request body.
HttpContent content = new ObjectContent<Product>(product, jsonFormatter);
// Send the request.
HttpResponseMessage resp = client.PostAsync(@"odata/Products/", content).Result;
var result = resp.Content.ReadAsStringAsync().Result;
我已经阅读了大约 2000 份手册和提要的问候,但无法弄清楚。
有什么线索吗?