Created
June 27, 2013 18:41
-
-
Save electricimp/5879174 to your computer and use it in GitHub Desktop.
Code snippet demonstrating how to do basic auth with an electric imp
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
function getBasicAuthHeader(user, password) { | |
local headers = { | |
"Authorization" : "Basic " + http.base64encode(user + ":" + password) | |
}; | |
return headers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment