cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: newbie question: URL encoding

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 9 Jul 2008 13:52:36 +0200 (CEST)

On Wed, 9 Jul 2008, mud honey wrote:

> I can do everything up to step 5 ok. The links on the index page are of the
> form http://somesite.com/blah/openfile.asp?crypt=%escape%sequenced%stuff
>
> Works fine in browser, can't get it to in cURL. I am using
>
> curl -b cookie "url_with_url%encoded%chars"
>
> I get back a bunch of binary crap that wrecks my linux terminal. It is
> definitely not the right stuff which is plain old HTML.

That's probably not because if how you entered the URL. The URL needs to be
"URL escaped" - which means %-encoding of certain letters.

If you don't get the same content with curl as with your browser, it is
usually rather a sign of the site detecting the user-agent and providing
different contents based on that. Like different user-agent, referer, cookies
or similar.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-09