我正在尝试将数据发布到Unix API,首先验证用户名和密码,然后保存已发送的数据。
我现在使用的代码是:
string strUrl = string.Format("http://moktrp.com/inf0/?username=fds- Sale003&password=CBA203&type=0&dlr=1&destination={0}&itemCode=1003);
WebRequest request = HttpWebRequest.Create(strUrl);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream s = (Stream)response.GetResponseStream();
StreamReader readstream = new StreamReader(s);
string datastring = readstream.ReadToEnd();
response.Close();
s.Close();
readstream.Close();
return true;