0

我的代码:

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);
4

1 回答 1

0

在我的最后测试了上面的代码(Ektron V9),它工作正常。

问题可能与您所指的 ektron 网站有关。

检查您发出 POST 请求的 Ektron 网站是否可访问。

于 2013-09-02T12:57:47.313 回答