Hi! I am getting a 400 bad request error when I go to a certain page in my web app. The code is copied below. Any help would be greatly appreciated! HTML Code:
<form method="POST" action="/sendorder/ordertype">
<div class="form-group">
<label for="FormControlSelect1">Select Size</label>
<select class="form-control" id="FormControlSelect1" name="SIZE">
<option>youth small</option>
<option>youth medium</option>
<option>youth large</option>
</select>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="EMAIL">
</div>
<div class="form-group">
<label for="add">Address:</label>
<input type="text" class="form-control" id="add" placeholder="Enter address" name="ADDRESS">
</div>
<div class="form-group">
<label for="note">Note:</label>
<input type="text" class="form-control" id="note" placeholder="Enter note" name="NOTE">
</div>
<button type="submit" class="btn btn-info">Submit</button>
</form>
Python/Flask Code:
@app.route('/sendorder/<order>', methods=['GET', 'POST'])
def sendOrder(order=None):
if request.method == "POST":
name = request.form['NAME']
email = request.form['EMAIL']
size = request.form.get('SIZE')
note = request.form['NOTE']
address = request.form['ADDRESS']