emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to non-interactively provide auth info to URL, and how to force


From: Ari Roponen
Subject: Re: How to non-interactively provide auth info to URL, and how to force URL to use HTTP AUTH
Date: 2009年12月16日 08:30:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

Hi,
"Edward O'Connor" <address@hidden> writes:
> Here's the scenario: I work on several elisp clients for various APIs
> which are exposed via HTTP and make use of HTTP AUTH. When a developer
> uses my library, they supply the relevant auth info to my library
> explicitly. I would then like to invoke url-retreive and have the
> resulting request use basic (or digest) auth with the auth info I
> already have, *without prompting the user* for a username or password. I
> keep failing to figure out how to do this.
I have used something like this to get status information from my
ADSL-modem. I don't know if it is the right thing, but it has worked for
me.
 (defvar telewell-default-auth
 `(("192.168.0.254:80"
 ("WebAdmin" . ,(base64-encode-string "admin:password"))))
 "Default authorization data for Telewell ADSL modem.")
 
 (defun telewell-get-data ()
 (let* ((url-show-status nil)
 (url-basic-auth-storage 'telewell-default-auth)
 (buf (url-retrieve-synchronously
 "http://192.168.0.254/adsl.asp";)))
 (when buf
 ...)))
 
-- 
Ari Roponen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]

AltStyle によって変換されたページ (->オリジナル) /