我的代码:
HttpWebRequest httpWReq = (HttpWebRequest)System.Net.WebRequest.Create(domainUrl + "/Workarea/webservices/WebServiceAPI/User/User.asmx/GetAllUserGroups");
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "OrderBy=Id";
byte[] data = encoding.GetBytes(postData);
httpWReq.Method = "POST";
httpWReq.ContentType = "application/x-www-form-urlencoded";
httpWReq.ContentLength = data.Length;
using (Stream stream = httpWReq.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
HttpWebResponse response = (HttpWebResponse)httpWReq.GetResponse();
string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
getXmlValue1(responseString);