1:https://ipnpb.paypal.com/cgi-bin/webscr?cmd=_notify-validate
2:https://ipnpb.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate
1这个url直接再浏览器里运行可以,用HttpWebRequest对象也可以获取.而
2这个url直接再浏览器里运行可以,用HttpWebRequest确显示:基础连接已经关闭: 发送时发生错误
请问什么问题呢?
赋上测试代码,请大神帮忙看看
var verificationResponse = string.Empty; try { var verificationRequest = (HttpWebRequest)WebRequest.Create("https://ipnpb.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate"); //var verificationRequest = (HttpWebRequest)WebRequest.Create("https://ipnpb.paypal.com/cgi-bin/webscr?cmd=_notify-validate"); verificationRequest.Method = "get"; verificationRequest.ContentType = "application/x-www-form-urlencoded"; var streamIn = new StreamReader(verificationRequest.GetResponse().GetResponseStream()); verificationResponse = streamIn.ReadToEnd(); streamIn.Close(); Response.Write(verificationResponse); } catch (Exception ex) { Response.Write(ex.Message); }