Does curl remove new line characters?

I'm posting a text file that contains a list on multiple lines to my service via curl. When I read the body of the request in my Spring MVC controller there are no new line characters and all text is on one line.

Does curl remove new line characters? Is there a way to maintain the new line characters as I need them to parse the text. Here is a snippet code that I am using to read the post body:

    StringBuilder builder = new StringBuilder();
    String line = null;

    try {
        BufferedReader reader = request.getReader();
        while ((line = reader.readLine()) != null) {// this is just one line of text!
            builder.append(line);
        }
    } catch (Exception e) { 
        //handle exception
    }

Solution 1:

Yes, curl removes linebreaks from data posted with the -d option. Use --data-binary instead. See SO question How to send line break with curl? for more info.