Flask Bad Request Error; ocurring because of multiple POST requests : <pre><code> &lt;form method = "POST"&gt;
         &lt;div class=" col-lg-4 col-lg-4 col-lg-4 col-lg-4"&gt;
            &lt;div class="box"&gt;
                &lt;input type="text" name="image-url" placeholder="Image URL Link"style="color:black" required="required" value = "new"/&gt;
              &lt;textarea cols=80 rows=4 style="color:black" name = "description" placeholder="Place your description here" value = "new"&gt;&lt;/textarea&gt;
                &lt;button type="submit"&gt;Upload&lt;/button&gt;
                &lt;/div&gt;
             &lt;/div&gt;
            &lt;/form&gt;                
    {% for i in range(amount_of_images) %}
         &lt;div class=" col-lg-4 col-lg-4 col-lg-4 col-lg-4"&gt;
              &lt;div class="box"&gt;
                &lt;img src="{{image[i]}}" alt="view" width = "300" height = "300"/&gt;
            &lt;form method = "POST"&gt;
                &lt;textarea cols=80 rows=4 style="color:black" name = "update-description" value = "update"&gt;{{description[i]}}&lt;/textarea&gt;
                    &lt;button type="submit"&gt;Update Description&lt;/button&gt;
            &lt;/form&gt;
</code></pre>

<p>Above is my HTML/Jinja Code</p>

<pre><code>@app.route("/gallery-manager", methods = ["GET", "POST"])
def gallery_manager():
if request.method == "POST":    
    if(request.form["image-url"] and request.form["description"]) is not None:
        model.add_new_image(request.form["image-url"], request.form["description"])
        id, image, description, amount_of_images = model.get_gallery()
        return render_template("gallery-manager.html", image = image, description = description, amount_of_images = amount_of_images, id = id)


    if request.form['update-description'] is not None:
        print("hello")



id, image, description, amount_of_images = model.get_gallery()
return render_template("gallery-manager.html", image = image, description = description, amount_of_images = amount_of_images, id = id)
</code></pre>

<p>Above is my Python/Flask Code...</p>

<p>The issue, when I click on the update-description submit button, aka the second POST being handled in the html code, I get a 400 error</p>

<pre><code>Bad Request
The browser (or proxy) sent a request that this server could not understand.
</code></pre>

<p>I realized that this error occurs when one of the POST fields are empty and can not be found. I understand that this happens because when I click the second POST submit button, it runs through the first POST check (request.form["image-url"] etc and finds that it is satisfied therefore wanting to run that code, but cant because update-description is still empty. How do I avoid this.</p>

<p>In other words how do I handle multiple POST methods.</p>

<p>Thank you,</p>
