Skip to content

Instantly share code, notes, and snippets.

@rlb3
Created February 4, 2012 22:30
Show Gist options
  • Select an option

  • Save rlb3/1740724 to your computer and use it in GitHub Desktop.

Select an option

Save rlb3/1740724 to your computer and use it in GitHub Desktop.
url auth
(let* ((my-auth '(("localhost:80" ("iOS Pratice" . "cm9iZXJ0OmtvbWJhdA=="))))
(url-basic-auth-storage 'my-auth))
(switch-to-buffer (url-retrieve-synchronously "http://localhost/~robert/pratice")))
(defmacro web-auth (&rest body)
`(let* ((my-auth '(("localhost:80" ("iOS Pratice" . "cm9iZXJ0OmtvbWJhdA=="))))
(url-basic-auth-storage 'my-auth))
,@body))
(macroexpand-all '(web-auth
(switch-to-buffer (url-retrieve-synchronously "http://localhost/~robert/pratice"))))
(web-auth
(switch-to-buffer (url-retrieve-synchronously "http://localhost/~robert/pratice")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment