vendredi 7 octobre 2016

400 Bad Request by the server

@admin.route("/add-challenge/", methods=["GET","POST"])
def add_challenge():
if request.method=="GET":
    return render_template("admin/addchallenge.html")
elif request.method=="POST":
    name=request.form["challenge_name"]
    category=request.form["challenge_category"]
    description=request.form["challenge_description"]
    points=int(request.form["challenge_points"])
    flag=str(request.form["challenge_flag"])
    author=request.form["challenge_author"]
    #do anything with this data



<form method="POST" action="">
<div class="input-field">
    <input id="chalname" name="challenge_name" type="text" />
    <label for="chalname">Challenge Name</label>
</div>
<div class="input-field">
    <input id="chalcat" name="challenge_category" type="text" />
    <label for="chalcat">Category</label>
</div>
<div class="input-field">
    <input id="chaldes" name="challenge_description" type="text" />
    <label for="chaldes">Description</label>
</div>
<div class="input-field">
    <input id="chalpoint" name="challenge_points" type="text" />
    <label for="chalpoint">Points</label>
</div>    <div class="input-field">
    <input id="chalflag" name="challenge_flag" type="text" />
    <label for="chalflag">Flag Format answer{}</label>
</div>    <div class="input-field">
    <input id="chalauthor" name="challenge_author" type="text" />
    <label for="chalauthor">Author</label>
</div>
<button class="btn waves-effect waves-light" type="submit">Login</button>

Bad Request

The browser (or proxy) sent a request that this server could not understand. I am getting the above error when I am trying to post the data. Please help me understand what is wrong and how can i rectify this




Aucun commentaire:

Enregistrer un commentaire