背景:我正在实施PayPal IPN处理程序。
太棒了
article
在PayPal的状态,我需要发送一个200确定返回贝宝后,我读了响应。
IPN请求的处理如下:
//Send the request to PayPal and get the response
StreamWriter streamOut = new StreamWriter(req.GetRequestStream(),
System.Text.Encoding.ASCII);
streamOut.Write(strRequest);
streamOut.Close();
StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
string strResponse = streamIn.ReadToEnd(); //returns VERIFIED
streamIn.Close();
根据下面的(文章),代码(我猜)应该发送一个200确定返回贝宝:
PayPal will respond with either VERIFIED or INVALID. After you receive this response, be sure to send 200 OK to prevent additional attempts from PayPal to send an IPN
我没有看到任何明确的HTTP响应被发送为“200好”。
使用的httpwebrequest是否自动发送200 OK?
如果是,在哪一点发生?
如果没有,如何使用httpwebrequest发送200 OK响应?使用httpwebrequest或sockets更容易做到这一点吗?