cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question

From: Michael Wood <esiotrot_at_gmail.com>
Date: Thu, 16 Feb 2012 08:27:11 +0200

On 16 February 2012 00:08, Kalju Kaik <kalju_at_aticts.com> wrote:
> When doing a curl string, if you are using the –u option to pass the user
> and password, if you use the @ sign in the password
> does it not pass correctly?
>
> eg
>
> -u “domain\user:@#$%^123”
>
> the password has @#$%^ as special characters.

You could try URL encoding the username and password. Not sure if
libcurl should be doing that automatically, although if it started now
it would probably break other people's code.

e.g.: -u "domain%5Cuser:%40%23%24%25%5E123"

The docs for CURLOPT_USERPWD don't mention URL encoding at all. They
do mention using domain/user or domain\user as the username, though,
implying that you don't need to encode that.

I'd just try encoding the lot (except the colon separating them, of
course), unless that doesn't work for some reason. I haven't tried
it.

-- 
Michael Wood <esiotrot_at_gmail.com>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-16