hi list,
inspired by this thread about getNetText and Proxies a couple of days
ago, I've now written a little parent script ("HTTP Class") for using
MultiUser xtra for all kind of HTTP requests. It's far from beeing
perfect, but maybe a good starting-point for further customizing.
It has the following features/advantages over standard net lingo:
- supports all HTTP/1.1 methods: GET, POST, HEAD, TRACE, OPTIONS, PUT
(e.g. HEAD can be useful to check if a server is running, or to find out
the size of some file without actually downloading it; TRACE can be used
to find out which Proxy-Server(s) exactly is/are used; ...)
- accessing password protected resources (Basic Authentication, like
common Apache .htaccess/.htpasswd protection)
- using Proxy-Servers (without or with Basic Authentication)
- sending arbitrary HTTP-Headers
- supports file uploads with POST (data is automatically base64-encoded,
script on the server has to decode it again) and PUT method
- Cookie-Support (send and receive session-cookies; support of
persistent cookies could easily be added)
- Session-Support (by automatic resending of session-cookie)
- resuming of interrupted downloads (simply by adding "Range:
bytes=<star-byte-number>-" and "If-Range: <date>" HTTP headers
- Browser-Spoofing
Included in the zip/sit is also a little tool called "HTTP Sniffer"
that's based on HTTP class. I allows to quickly send arbitrary HTTP
requests to any URL, and analyze the response (a bit like the "Live HTTP
headers" Firefox extension, but more powerfull). Maybe it can be useful
to examine http-network problems or debug server scripts...
It's at
http://dasdeck.de/staff/valentin/lingo/http_class/
Feedbacks and ideas for improvements welcome.
Cheers,
Valentin
Valentin Schmidt wrote:
Propably I'm the only one interested in this :-)
But anyway, I've checked it out, it's really very easy to do this for
basic authentication. You only have to add one more HTTP-header line:
"Proxy-Authorization Basic YWRtaW46Zm9v"
where YWRtaW46Zm9v is a base64 encoded string of <username:password>
("admin:foo" in this case), and you have to use a full URL in the
GET-line
(like "GET http://macromedia.com/robots.txt")
If you specify this additional header right away from the beginning,
there is no need for an "interactive authentication", you get through
the proxy immediately (tested with Squid 2.5 on win xp)
So, Tim, if your proxy server uses basic authentication only, there
is no need to buy a third party xtra.
Valentin
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]