http - How to retrieve a web page needing authentication in Emacs, can't get url.el to authenticate -
i'm using following code:
(defvar xyz-user-name "login") (defvar xyz-password "pass") (defvar site "http://www.site.com/") (defvar xyz-block-authorisation nil "flag whether block url.el's usual interactive authorisation procedure") (defadvice url-http-handle-authentication (around xyz-fix) (unless xyz-block-authorisation ad-do-it)) (ad-activate 'url-http-handle-authentication) (defun login-show-posts () (interactive) (let ((xyz-block-authorisation t) (url-request-method "get") (url-request-extra-headers `(("authorization" . ,(concat "basic " (base64-encode-string (concat xyz-user-name ":" xyz-password))))))) (url-retrieve site (lambda (status) (switch-to-buffer (current-buffer))))))
but webpage text without authentication, i.e. didn't authenticate. how can make authenticate. i've been busting brains, reading on url-request-extra-headers find, can't done.
anyone?
thanks
jj
Comments
Post a Comment