Created
May 17, 2012 18:19
-
-
Save pbuckley-personal/2720716 to your computer and use it in GitHub Desktop.
basic auth with clojure http.async
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn fetch-url-with-auth | |
| "Get a URL using HTML basic authentication" | |
| [url username password] | |
| (with-open [client (c/create-client)] | |
| (let [resp (c/GET client url :auth {:user username :password password :preemptive true})] | |
| (c/await resp) | |
| (c/string resp)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment