Background: I am implementing Paypal IPN handler.
This great article on Paypal states that I am required to send a 200 OK back to Paypal after I read the response.
The processing of IPN request is as follows:
//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();
According to the following (from the article), the code (I guess) is supposed to send a 200 OK back to Paypal:
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
I do not see any explicit HTTP response being sent as "200 OK".
Does the used HttpWebRequest send a 200 OK automatically?
If yes, at which point does that occur?
If not, how can one send 200 OK response using HttpWebRequest? Is it easier doing that using HttpWebRequest or sockets?