This file contains 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
val h = new Http | |
val req = url("url to request").as_!("user name", "password") | |
val rsp = h(req as_str) |
I believe using as will make a request without authentication, look for a 401 response header, and then re-issue the request with authentication. The Github API, and many others I imagine, do not send a 401 response back when not authenticated.
3 comments:
Thank you so much for this! Saved me at least a day.
Thx!!! It was very helpful for me! =)
Thank you so much mate!
Saved me a whole lot of trouble
Post a Comment