Created
February 9, 2015 10:45
-
-
Save galchenkov/07313144347b4951305c to your computer and use it in GitHub Desktop.
Get base64 encoded image
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
request.get imageUrl, (error, response, body) -> | |
if not error and response.statusCode == 200 | |
data = "data:" + response.headers["content-type"] + ";base64," + new Buffer(body).toString('base64') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment