我使用 MassPaymentAPI 创建了 MassPayment 但此方法出现错误
输入方法 :::
url="https://api.sandbox.paypal.com/nvp"
postdata="METHOD=MassPay&EMAILSUBJECT=You+have+money!&RECEIVERTYPE=EmailAddress&CURRENCYCODE=USD&L_EMAIL0=bhaumik50%40gmail.com&L_Amt0=1.00&L_UNIQUEID0=&L_NOTE0=&USER=rserasiya_api1.gmail.com&PWD=OneIsTheLonliestNumber&VERSION=1&SOURCE=1" ;
timeout= "3600" ;
X509certificate = "Certifcate Description"
public static string HttpPost(string url, string postData, int timeout, X509Certificate x509)
{
HttpWebRequest objRequest = (HttpWebRequest) WebRequest.Create(url);
objRequest.Timeout = timeout;
objRequest.Method = "POST";
objRequest.ContentLength = postData.Length;
if (null != x509)
{
objRequest.ClientCertificates.Add(x509);
}
using (StreamWriter myWriter = new StreamWriter(objRequest.GetRequestStream()))
{
myWriter.Write(postData);
}
using (WebResponse response = objRequest.GetResponse())
{
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
return sr.ReadToEnd();
}
}
}
在这种方法中,我使用 StreamWriter 对象成功发送了请求,但我没有从贝宝网站得到响应,我该怎么办?请回复..
我的错误是:底层连接已关闭:连接意外关闭。
我放置了引发错误和浏览器错误的方法的图像。
请给我你的建议