title: Python+Flask : how to get text from request with newlines?
body: <p>I am not sure how it works, but it worked in one of my projects and doesn't works in a new one.
  Obviously, I am missing something.</p>
  
  <p>I want a simple REST server with only one POST.
  It should get text from POST request. Text contains newlines.</p>
  
  <p>This is my text.txt:</p>
  
  <pre><code>hello
  how are you
  </code></pre>
  
  <p>This is how I test it:</p>
  
  <pre><code>curl -i -s -X POST -d @test.txt http://*ip*:*port*/api/gogogo
  </code></pre>
  
  <p>This is part of my python script with flask app:</p>
  
  <pre><code>@app.route('/gogogo', methods=['POST'])
  def translate():
      request_str = request.get_data().decode('utf-8').strip()
      request_lines = request_str.split('\n')
      print(request_lines)
      return "yeah"
  </code></pre>
  
  <p>But "print(request_lines)" prints "hellohow are you".
  Any ideas?
  I also tried to use <br> instead of '\n', didn't help. And even if it did - my requests use '\n', so i have to support this format.</p>