When is a Post not a Post. When its a Get puzzle

Discussion in 'ASP.NET / ASP.NET Core' started by nigpig, Mar 9, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Im trying to receive an HTTP post from SagePay as the notification post that the card tx has gone through. My live site is reading this as a Get not a post and so cannot get at the form variables. If a simulate a post on localhost in dev mode it works fine.

    I have another site (with DiscountASP on iis7, .net 4) that I put the same identical aspx page on. It works fine as Post is read as Post.
    Most of the differences are in the web.config. I'm wondering if it is something to do with authentication.

    On first site I use forms authentication.
    On second site I use none
    <authentication mode="None" />

    Anyone have any ideas what is causing this?

    I have tried moving my page to a folder and giving it its own web.config file. But it wont let me change the authentication mode to none as it would have to be a differenent iis application. Not done this before. Would it be a simple thing to set up and would it still work with the same namespace as my other pages etc.
     
  2. This is from the non-working post that is a get and does not work as it should
    -------------------------------------------------------------------------------
    Request Headers = Connection=Keep-Alive&Accept=*%2f*&Host=www.printer-ink-toner.co.uk&User-Age
    nt=Mozilla%2f4.0+(compatible%3b+Win32%3b+WinHttp.WinHttpRequest.5)
    Request Method = GET
    Request Querystring =
    Request Forms collection count = 0



    This is from a simulated post I created from another site of mine. It works
    ---------------------------------------------------------------------------------
    Request Headers = Connection=keep-alive&Keep-Alive=115&Content-Length=364&Content-Type=application%2fx-www-form-urlencoded&Accept=text%2fhtml%2capplication%2fxhtml%2bxml%2capplication%2fxml%3bq%3d0.9%2c*%2f*%3bq%3d0.8&Accept-Charset=ISO-8859-1%2cutf-8%3bq%3d0.7%2c*%3bq%3d0.7&Accept-Encoding=gzip%2cdeflate&Accept-Language=en-gb%2cen%3bq%3d0.5&Cookie=__utma%3d54248041.493086359.1291982588.1292319109.1292324648.13%3b+__utmz%3d54248041.1291982588.1.1.utmcsr%3d(direct)%7cutmccn%3d(direct)%7cutmcmd%3d(none)%3b+__utma%3d1.1581796167.1293287378.1299681032.1299687681.153%3b+__utmz%3d1.1298294014.110.31.utmcsr%3dlocalhost%3a52992%7cutmccn%3d(referral)%7cutmcmd%3dreferral%7cutmcct%3d%2fast_web%2fdefault.aspx&Host=www.printer-ink-toner.co.uk&Referer=http%3a%2f%2flocalhost%3a58188%2fAST_Web%2fCheckout_NotificationTest.aspx&User-Agent=Mozilla%2f5.0+(Windows%3b+U%3b+Windows+NT+6.1%3b+en-GB%3b+rv%3a1.9.2.15)+Gecko%2f20110303+Firefox%2f3.6.15
    Request Method = POST
    Request Querystring =
    Request Forms collection count = 16
     
  3. I fixed this.
    I realised from the logs that the post was getting a 301 redirect. This resulted in the Get behavior subsequently.
    This is because any non lowercase urls get redirected perminantly to lower case urls and this was the case. silly me!
     
  4. mjp

    mjp

    Cool. Glad it's working for you now.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page