Ok -
so I'll write it again - as this is driving me up the wall. The User
guide even has an "example" saying you should be able to do this... But,
it still doesn't work.
REBOL [
Title: "Password Page Retreival"
Date: 25-Jan-2000
Purpose: "A script to fetch a web page that uses basic authentication"
File: %getsecurepage.r
Notes: {
A quick test of the scheme mechanism of reading a URL -
this should allow for retrieval of web pages that are
located behind a password protected challenge.
}
]
http_file: make url! "http://webuser:[EMAIL PROTECTED]/mysite/"
print http_file
print read http_file
I'm on Windows NT - and I have IIS running. mysite is a protected
directory, which the username of "webuser", and the password of
"letmein" grants access. If I copy and paste that URL into a new
web-browser (i.e. it doesn't have the username and password cached),
whether it's IE, or NS - it works - brings up the page and everything.
Yet - here's what REBOL produces:
>> do %getsecurepage.r
Script: "Secure Page Retreival" (25-Jan-2000)
http://webuser:[EMAIL PROTECTED]/mysite/
connecting to: 127.0.0.1
** User Error: Error. Target url: http://127.0.0.1/mysite/ could not be
retrieved. Server response: HTTP/1.1 401 Access Denied.
** Where: print read http_file
As you can see I print the URL - just to be sure it's not dropping the
username and password for some reason. Yet on the attempt to read that
URL, you can see that it seemingly drops the user:pass right out of the
URL...
I've also tried the following variant:
print read [
scheme: 'http
user: "webuser"
pass: "letmein"
host: "127.0.0.1/mysite/"
]
with the same results. Is this just broken?
- Porter Woodward