Note that there are some explanatory texts on larger screens.

plurals
  1. POPaypal Sandbox IPN not detecting Content-type
    text
    copied!<p>I've been using the past few hours attempting to figure out why the Paypal Sandbox IPN Simulator isn't detecting a Content-type on my request back. I didn't modify any of the code where the request back is made, so it's odd that it's not going through correctly.</p> <p>There was a <a href="https://stackoverflow.com/questions/15422636/ipn-simulator-cannot-extract-response-no-content-type-found">similar question</a> back in March, though the answer he marked didn't seem to do the trick for me.</p> <p>Does anyone have any idea on why this is happening? Has this happened to anyone else recently?</p> <pre><code>public class PaypalIPN : IHttpHandler, IRequiresSessionState { public void ProcessRequest (HttpContext context) { //post back to either sandbox or live string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr"; string strLive = "https://www.paypal.com/cgi-bin/webscr"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox); //Set values for the request back req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; byte[] param = context.Request.BinaryRead(HttpContext.Current.Request.ContentLength); string strRequest = Encoding.ASCII.GetString(param); strRequest += "&amp;cmd=_notify-validate"; req.ContentLength = strRequest.Length; //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(); streamIn.Close(); ... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload