您需要一个json序列化程序来解析您的内容,也许您已经有了它,对于有关如何发出请求的最初问题,这可能是一个主意:
var baseAddress = "http://www.example.com/1.0/service/action";var http = (HttpWebRequest)WebRequest.Create(new Uri(baseAddress));http.Accept = "application/json";http.ContentType = "application/json";http.Method = "POST";string parsedContent = <<PUT HERE YOUR JSON PARSED CONTENT>>;ASCIIEncoding encoding = new ASCIIEncoding();Byte[] bytes = encoding.GetBytes(parsedContent);Stream newStream = http.GetRequestStream();newStream.Write(bytes, 0, bytes.Length);newStream.Close();var response = http.GetResponse();var stream = response.GetResponseStream();var sr = new StreamReader(stream);var content = sr.ReadToEnd();
希望能帮助到你,
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)