title: Send json array data from html to Flask
body: <p>I have a variable, called images, in my frontend holding a handful of images selected by the user. 
  The following:</p>
  
  <pre><code>JSON.stringify(images) 
  </code></pre>
  
  <p>would then return</p>
  
  <pre><code>["image1", "image2", "image3"]
  </code></pre>
  
  <p>if the user selected the first three images. </p>
  
  <p>I want to POST this array to Flask, make flask do some manipulation and then return the images in a new route. 
  My jQuery script for the HTTP post looks as follows:</p>
  
  <pre><code>$("document").ready(function() {
  $("#btn1").click(function(){  
  $.ajax({
  type: 'POST',
  contentType: 'application/json',
  url:  "{{ url_for('filter') }}",
  dataType : 'json',
  data : JSON.stringify(images) 
  })
  })
  })
  </code></pre>
  
  <p>The route responsible for the manipulation looks as follows:</p>
  
  <pre><code> @app.route("/filter", methods=["POST", "GET"])
   def filter():
       if request.method=="POST":
           result=request.get_json()
           ## Do some manipulation to result
   return render_template("result.html",result=result)
  </code></pre>
  
  <p>My problem is that the data retrieved by Flask is empty.</p>