title: How to return a json file line by line in flask?
body: <p>I am writing a api to download json file. Suppose I have 3 dict:</p>
  
  <pre><code>{"task_name":"task1","task_info":"aaaaa"}
  {"task_name":"task2","task_info":"bbbbb"}
  {"task_name":"task3","task_info":"ccccc"}
  </code></pre>
  
  <p>I want to return these dict into one json file.Here is what I did:</p>
  
  <pre><code>data = json.dumps(tasks_info, default=str)
  response = make_response(data, 200, {'mimetype': 'application/json'})
  response.headers['Content-Disposition'] = "attachment;filename={}.json".format(urllib.parse.quote('result'))
  return response
  </code></pre>
  
  <p>tasks_info is a list that contains 3 dict.
  The result file open like that:</p>
  
  <pre><code>[{"task_name":"task1","task_info":"aaaaa"},{"task_name":"task2","task_info":"bbbbb"},{"task_name":"task3","task_info":"ccccc"}]
  </code></pre>
  
  <p>It is a very long line.
  What I want to get looks like </p>
  
  <pre><code>[   // the '[' and ']' is not necessary
  {"task_name":"task1","task_info":"aaaaa"},
  {"task_name":"task2","task_info":"bbbbb"},
  {"task_name":"task3","task_info":"ccccc"}
  ]
  </code></pre>
  
  <p>I want every dict show in a distinct line instead of every dict shown in same line.
  Are there any way to change the result file look like?</p>