cURL / Mailing Lists / curl-users / Single Mail

curl-users

url encoding question

From: David Byron <DByron_at_everdreamcorp.com>
Date: Thu, 18 Dec 2003 17:01:17 -0800

I have a feeling this question comes up fairly often, but I haven't seen it
in awhile (although there was that --data-encode or similar proposal
recently but this is slightly different). A quick search of the mailing
list came up empty.

The man page doesn't explicitly say this, but I believe the URL given to
curl (e. g. via --url) must be url-encoded already.

Here's my situation. I need my URL to eventually be the url-encoded version
of:

http://www.foo.com/blah blah/nasty file name.asp?yucky data=5

I already handle the ?yucky data=5 part by url-encoding it myself and then
calling --data.

So, I'm left with handling

http://www.foo.com/blah blah/nasty file name.asp

myself.

I see all that nice url parsing code in lib/url.c and it seems like there's
probably an easy place to call curl_escape there.

Anyone know where that place is (in lib/url.c or maybe elsewhere)? If I can
find it/them and send a patch, is there a good chance it'll get accepted?
I'm guessing it would have to be via a new option so all the people that
pass already-encoded urls won't have to change anything.

Thanks.

-DB

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-19