cURL / Mailing Lists / curl-users / Single Mail


Re: new line in command promt

From: Daniel Stenberg <>
Date: Wed, 1 Dec 2004 20:17:50 +0100 (CET)

On Wed, 1 Dec 2004, eric bioul wrote:

> But what should I do when needing this?
> post
> content length=150
> ...
> connection=keep alive
> amaai kroket [enter or new line]
> [enter or new line]
> das moeilijk
> Does anyone know the answer or a place where I can find this sollution?

If you *really* want a newline in the data, perhaps your shell supports
something like

   curl -d "line1\nline2" [URL]

Or you can create a file with all the post data and you post it with

   curl --data-binary @filename [URL]

BUT note that -d post data is supposed to be "URL-encoded" already. The
receiving end will decode %XX-codes. Thus, you can provide a newline with %0a
and a carriage return (should you want that) with %0d. Like:

   curl -d "line1%0dline2" [URL]

      Daniel Stenberg -- --
       Dedicated custom curl help for hire:
Received on 2004-12-01