标签:http exception info _id efi receive cep new 响应
}
在url页面 处理请求 //接收receipt-data
byte[] byts = new byte[Request.InputStream.Length];
Request.InputStream.Read(byts, 0, byts.Length);
sReceiptData = System.Text.Encoding.Default.GetString(byts);
string[] Data = sReceiptData.Split(‘&‘);//获取參数
get请求
public string Response(string url)
{
try
{
GetConfig con = new GetConfig();
string prfix = con.UrlPreFix;//获取地址前缀
string strURL = prfix + url;//创建一个訪问地址
System.Net.HttpWebRequest request;
request = (System.Net.HttpWebRequest)WebRequest.Create(strURL);//创建一个HTTP请求
request.Method = "get";//发送请求
System.Net.HttpWebResponse response;
response = (System.Net.HttpWebResponse)request.GetResponse();//获取响应
StreamReader sr = new StreamReader(response.GetResponseStream());
string jsonstr = sr.ReadToEnd();
return jsonstr;
}
catch (Exception)
{
return "The server connection error.";
}
}
标签:http exception info _id efi receive cep new 响应
原文地址:http://www.cnblogs.com/liguangsunls/p/6949564.html