cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Posting with ----data-urlencode

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 13 Sep 2010 23:04:41 +0200 (CEST)

On Mon, 13 Sep 2010, Kyle Welsh wrote:

Please don't top-post.

> I believe I need a multipart frompost. Just having problem with filling in a
> box with spaces, line breaks and returns.

Really?

> When I try encode it manually it does not seem to work.
> E.G.
> -F "This%20is%20a%20string"

That's not how it works.

First, use LiveHTTPHeaders and see what your browser does. There you'll learn
that multipart formposts sends the data as-is unencoded and just separates the
data pieces with separators. -F "name=this is a string" is how it is supposed
to be done.

Of course, if you want to feed newlines you'll need to play with your command
line or use other curl tricks like -F "name=<filename" or similar.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-13