A web server is running (on EC2) and I’m testing this simple Html5 login form with a method=”post” attribute in two ways:
- as-is
- within a larger website
<div> <form action="" method="post" > <p/> <input id="username" type="text" name="username" placeholder="Username" > <p/> <input id="password" type="password" name="password" placeholder="Password" > <p/> <input type="submit" class="btn" value="Login"> </form> </div>
A handler in the Python-based web server includes:
username = self.get_argument('username')
password = self.get_argument('password')
The first method works with a Http 200 but the second generates a Http 405 “Method Not Allowed”. Both use the identical handler code on the web server.
I cannot find where the problem is. What is the best way to debug this?
The problem was with the web-server and the order of the parameters/attributes for the Class function handling the Post method.