Site requiring authorization
[1/5] from: chalz:earthlink at: 13-Jun-2002 0:12
Greetings folks. I try downloading a file through HTTP from REBOL/Core.
Thing is, I get a 401 auth required error. How can I get around this? When I
grab the file with IE, it pops up a dialog box asking for user and password.
In my case, the user is the email address. For instance:
user: [me--site--dom]
pwd: fubar
file: http://www.site.dom/file.bin
So I want to write/binary %somedir/data.bin read/binary file .. but get 401.
Any info folks? Thanks!
--Charles
[2/5] from: serdar:skilic at: 13-Jun-2002 15:50
Hi Charles,
Try this http://me:[fubar--www--site--dom]/file.bin
Regards,
Serdar Kilic | skilic.com
[3/5] from: chalz::earthlink::net at: 13-Jun-2002 3:48
Greets Serdar.
I was going to do that, except the username is an email address. So it'd
be:
[user--dom]:[fubar--www--site--dom]/file.bin
Would that work? (I'm not on my REBOL machine at current to test it.)
Thanks.
[4/5] from: brett:codeconscious at: 13-Jun-2002 17:52
Hi Charles,
Have a look at http://www.rebol.com/docs/core23/rebolcore-13.html#sect2.2.
You will probably need to use the READ [...] format, specifying username and
password
(see the FTP) example.
Brett.
[5/5] from: gscottjones:mchsi at: 13-Jun-2002 7:30
<<Reformatted>>
> From: "Charles"
> > Greetings folks. I try downloading a file through
<<quoted lines omitted: 10>>
> > read/binary file .. but get 401.
> > Any info folks? Thanks!
From: "Brett Handley"
<snip>
> Have a look at http://www.rebol.com/docs/core23/rebolcore-13.html#sect2.2.
>
> You will probably need to use the READ [...] format, specifying username
and
> password
> (see the FTP) example.
Hi, Charles (and Brett),
The method that Brett refers to avoids the need to parse the user/pass/url
request:
read [
scheme: 'FTP
host: "ftp.example.com"
port-id: 8000
target: %/file.txt
user: "bill"
pass: "vbs"
]
The problem is that the current url parse rule does not recognize the "@"
symbol as part of a valid user name. An alternative to Brett's suggestion
is to patch the character set by adding "@" as being valid (watch for line
wrap).
net-utils/url-parser/user-char: union net-utils/url-parser/user-char make
bitset! #"@"
With this patch you (hopefully) would be able to do something like:
write/binary read http://[me--site--dom]:[fubar--www--site--dom]/file.bin
%somedir/data.bin
There is some additional explanation
http://www.escribe.com/internet/rebol/m10936.html
Again, either method can work, depending on your preference.
Regards,
--Scott Jones
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted