title: Flask+cURL concatenates multi-line CSV input into a single string
body: <p>I have a route in my <code>flask</code> app that starts off like this:</p>
  
  <pre><code>@app.route('/invocations', methods=['POST'])
  def predict():
      """
      Do an inference on a single batch of data.
      """
      if flask.request.content_type == 'text/csv':
          X_train = flask.request.data.decode('utf-8')
          X_train = pd.read_csv(StringIO(X_train), header=None).values
  </code></pre>
  
  <p>To test this path I am sending a <code>POST</code> request to the server from a <code>csv</code> formatted file with multiple lines in it: <code>curl -X "POST" -H "Content-Type: text/csv" -d @health-check-data.csv http://localhost:5000/invocations</code>.</p>
  
  <p>However, to my surprise, when I execute <code>X_train = flask.request.data.decode('utf-8')</code>, I get the contents of the <code>csv</code> concatenated into a single string with newlines removed.</p>
  
  <p>Why is <code>flask</code> (or <code>curl</code>?) doing this, and how do I get around this behavior?</p>