Search code examples
dospostdatalynx

Lynx removes newline characters from post_data input


I am trying to post a file to a URL via the MS-DOS command prompt. I am using the Lynx browser to do this. I am able to post my file just fine, but all of the newline characters are removed by Lynx before creating the POST request. Is it possible to post a file via command line without having the newline characters removed? The command I am running is:

lynx -post_data http://www.myserver.com/myscript.pl < testfile.txt

The input file, testfile.txt, looks like this:

test=This

is

a

test.;
---

The data that actually gets sent across the wire looks like this:

test=Thisisatest.;

Solution

  • I actually found cURL to be a far better utility to post a file via MS-DOS.