http password

Dave Cragg dcragg at lacscentre.co.uk
Tue Feb 3 17:56:14 EST 2004


At 3:08 pm -0500 3/2/04, Zac Elston wrote:
>i have a url that is
>"http://username:password@hostname/path/file.pl?var1=foo
>
>when using this url in a browser, it works
>
>when using "Get URL myquery" i get empty.
>
>even "get URL urlencode(myquery)" returns empty.
>
>what's the trick to getting this to work?

First check "the result" to see if any error has been reported. (You 
should always do this after any url call.)

If the result contains a 401 code, this means the username and 
password weren't authenticated. If you are sure the name and password 
are correct, you can try urlEncoding them. But this is only necessary 
if they contain any "funny characters", i.e non-alphanumeric 
characters. As Jan said,  urlEncode the username and password first, 
and then add them to the url string.

If the result contains something like "invalid url" then libUrl may 
have been unable to parse the url. Some versions of libUrl have 
problems in parsing urls that contain other urls in the query string 
(the bit after the "?") You could try updating to the latest version 
of libUrl (1.0.13). You can get it here:

<http://www.runrev.com/revolution/developers/interimreleases/liburl/releases.shtml>

At 1:43 pm -0700 3/2/04, Alex Rice wrote:
>Web browsers translate the http://username:password@hostname URL
>into the appropriate HTTP headers but maybe libURL doesn't do that.

You must have more faith, Alex. <just kidding>

<http://www.runrev.com/revolution/developers/interimreleases/liburl/liburldoc.shtml#authorization>

Cheers
Dave


More information about the use-livecode mailing list