cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: showing url encoded data with --form and -v

From: Daniel Stenberg <Daniel.Stenberg_at_haxx.nu>
Date: Tue, 15 Feb 2000 17:42:35 +0100 (MET)

On Mon, 14 Feb 2000 aldomel_at_ix.netcom.com wrote:

> I have a feature request then: an option to take name=content bits and
> make a url-encoded POST or GET from it.

That's a fair idea.

Now, how would the syntax be? Assume that you want to send a variable that
contains a = character, how do I escape that?

> If a sepreate utility exits for this put a note in the docs, I wouild
> suggest.

It is a very simple syntax and making a perl script do it is a matter of a
one-liner:

  echo "test åäö" | perl -e '$_=<STDIN>; $_=~s/([^a-zA-Z0-9_.-])/uc
  sprintf("%%%02x",ord($1))/eg; print "$_\n";'

> (I am looking for a program like that, too btw.)

Enjoy! ;-)

-- 
   Daniel Stenberg - http://www.contactor.se/~dast - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on 2000-02-15