接口
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); request.Method = "POST"; request.ContentType = "application/json"; request.ContentLength = Encoding.UTF8.GetByteCount(postDataStr); byte[] data = Encoding.UTF8.GetBytes(postDataStr); string bytestring = Encoding.UTF8.GetString(data); Stream os = null; try { request.ContentLength = data.Length; os = request.GetRequestStream(); os.Write(data, 0, data.Length); HttpWebResponse wr = (HttpWebResponse)request.GetResponse(); Stream receiveStream = wr.GetResponseStream(); StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8); string content = reader.ReadToEnd(); return content; } catch (Exception es) { //MessageBox.Show(es.InnerException.Message.ToString()); return ""; }