我正在尝试JsonObject
通过HttpClient
Web API发布。我不太确定该怎么做,在示例代码中找不到太多。
这是我到目前为止的内容:
var myObject = (dynamic)new JsonObject();
myObject.Data = "some data";
myObject.Data2 = "some more data";
HttpClient httpClient = new HttpClient("myurl");
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = httpClient.Post("", ???);
我想我需要把我JsonObject
当成演员,StreamContent
但是我对此很挂念。