使用JSON进行POST()
这个问题在这里已经有了答案:
var request = WebRequest.CreateHttp(myUrl + "/" + uri);
request.Credentials = new NetworkCredential(myUserName, myPassword, myDomain);
request.ContentType = "application/json; charset=utf-8";
request.Method = "POST";
using (StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
string jsonstring = JsonConvert.SerializeObject(myJsonobject, Formatting.Indented);
streamWriter.Write(jsonstring);
streamWriter.Flush();
}
看上面
链接地址: http://www.djcxy.com/p/45867.html