HTTP Error 405.0 - Method Not Allowed

Discussion in 'HTML / PHP / JavaScript / CSS' started by Will1968, Jan 27, 2009.

  1. I am getting the following error message when I call or execute a cgi script from another website.

    HTTP Error 405.0 - Method Not Allowed

    The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
    I have attached a screen shot of the error message.

    I have edited the "Feature Permissions" in the IIS 7.0 Manager to allow executable and tried changing some of the other permissions. I presume this where the problem is?

    The CGI file receives some variables....orderref, name, address, town, county, postcode, formattedamount, timestamp, streference, stauthcode and uses them in the cgi file to write to a log file call.log

    The CGI file and log file are in the cgi-bin folder.

    The CGI file is as follows...

    # Read in variables from user's browser
    print "Content-type: text/html\n\n";
    print "<html></body></html>\n";

    print "Starting";

    # Parse the input
    if ($ENV{'REQUEST_METHOD'} eq 'POST') {
    read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    } else {
    $buffer = $ENV{'QUERY_STRING'};
    }
    @pairs = split(/&amp;/, $buffer);
    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $PARAM{$name}=$value;
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $FORM{$name} = $value;
    }

    # Write the logfile
    open(LOG,">>call.log");
    print LOG "-----------------------------------------------------------------------\n";
    foreach $a (keys %FORM) {
    print LOG "$a:",$FORM{$a};
    print LOG "\n";
    }
    print "Finished";
    close(LOG);
     

    Attached Files:

  2. Bruce

    Bruce DiscountASP.NET Staff

    I am not sure how you call the CGI page from your other app so it is hard to tell you what is going on. do you get the same error when you visit the page on your browser?
     
  3. Will;

    What was the resolution to your problem? I'm encountering the same issue.
     
  4. Never found a solution

    I was trying to configure and online payments provider.

    In the end I just moved to a different payments provider.

    Sorry.
     
  5. I'm seeing this also

    I'm using POST to pass XML from a form to an aspx page on the server. It works fine on my local dev environment, but not on Discountasp.net. I've researched it, it seems to be an issue of the verb "POST" not being allowed, i.e. IIS is not configured to allow you to post. I've submitted a request to discountasp.net support to enable this for my domain.. I know of no other way to get this done. Anyone have an alternate suggestion?
     
  6. Discountasp.net support got back to me (quickly as always) on this. POST is enabled by default. You can verify this, and get to other IIS settings using the Microsoft IIS 7.0 Manager.
     

Share This Page