Skip to content

Instantly share code, notes, and snippets.

@galchenkov
Created February 9, 2015 10:45
Show Gist options
  • Save galchenkov/07313144347b4951305c to your computer and use it in GitHub Desktop.
Save galchenkov/07313144347b4951305c to your computer and use it in GitHub Desktop.
Get base64 encoded image
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