David Christopher Asher wrote:
> 
> Hello,
> 
> I am using wget to invoke a CGI script call, while passing it several
> variables.  For example:
> 
> wget -O myfile.txt
> "http://user:[EMAIL PROTECTED]/myscript.cgi?COLOR=blue&SHAPE=circle"
> 
> where myscript.cgi say, makes an image based on the parameters "COLOR" and
> "SHAPE".  The problem I am having is when I need to pass a key/value pair
> where the value contains the "&" character.  Such as:
> 
> wget -O myfile.txt "http://user:[EMAIL PROTECTED]/myscript.cgi?COLOR=blue
> & red&SHAPE=circle"
> 
> I have tried encoding the "&" as %26, but that does not seem to work (spaces
> as %20 works fine).  The error log for the web server shows that the URL
> requested does not say %26, but rather "&".  It does not appear to me that
> wget is sending the %26 as %26, but perhaps "fixing" it to "&".

You have hit one of Wget "features", it is overzealous in converting
URLs into canonical form. As you have discovered Wget first converts all
encoded characters back to their real value and then encodes all those
that are unsafe sending in URLs.

I  know of no workaround for this "feature". I tried encoding the '%'
yet another time like '%2526' but Wget then send the whole thing '%2526'
8-(

> 
> I am using GNU wget v1.5.3 with Red Hat 7.0

Note that the latest version is 1.6 available from a GNU mirror near
you. See the web-site (http://sunsite.dk/wget/) for directions.

> 
> Thanks!
> 
> --
> David Christopher Asher

-- 
Med venlig hilsen / Kind regards

Hack Kampbjørn               [EMAIL PROTECTED]
HackLine                     +45 2031 7799

Reply via email to