The following question provides background for this question
I am posting form data to a Flask URL. The HTML form looks like so.
{% extends "AdminMaster.html" %} {% block title %}Create New Application{% endblock %} {% block page %}Create New Application{% endblock %} {% block head %} {{ super() }} {% endblock %} {% block content %}
<div class="container">
<div class="page-header">
<h1>Create a new Application</h1>
</div>
<form action="/xxxx/xdf">
<div class="form-group">
<label for="txtApplicationName">Application Name</label>
<input type="text" class="form-control" id="txtApplicationName" placeholder="Application Name">
</div>
<div class="form-group">
<label for="txtApplicationCategoryName">Application Category Name</label>
<input type="text" class="form-control" id="txtApplicationCategoryName" placeholder="Application Category">
</div>
<button type="submit" class="btn btn-primary">
Add New Category
</button>
</form>
</div>
{% endblock %}
I have the following Flask route to handle the post.
@admin_routes.route('/xxxx/xdf', methods=['GET', 'POST'])
@authenticate_admin
def create_new_application():
app_name = request.args[0]
return redirect('/xxxx')
The problem is everytime I make a post I get the 400 Bad Request. I am not sure why ?