Antecedentes: estoy implementando el controlador Paypal IPN.¿HttpWebRequest envía 200 OK automáticamente?
Este gran article en Paypal indica que estoy obligado a enviar un 200 OK de nuevo a Paypal después de leer la respuesta.
El procesamiento de la solicitud IPN es la siguiente:
//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();
De acuerdo con lo siguiente (del artículo), el código (supongo) se supone que enviar un 200 OK de nuevo a 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
No veo ninguna respuesta HTTP explícita que se envíe como "200 OK".
¿El HttpWebRequest utilizado envía un 200 OK automáticamente?
En caso afirmativo, ¿en qué momento ocurre eso?
En caso negativo, ¿cómo se puede enviar una respuesta 200 OK utilizando HttpWebRequest? ¿Es más fácil hacerlo usando HttpWebRequest o sockets?
No estoy familiarizado con esta API de PayPal, sin embargo, HttpWebRequest no envía un estado. Recibe un estado del servidor cuando realiza una solicitud. ¿Puedes dar el enlace al artículo que haces referencia? –
¿Qué "gran artículo sobre PayPal" sería eso? – AnthonyWJones
Lo siento, olvidé de pegar el enlace. Aquí: http://www.codeproject.com/KB/aspnet/paypal_c_aspnet.aspx#PostPayment También editó la publicación. – Marek