26.10.2017, 10:15
You already have a function for HTTP requests, just get your snapshot by calling cmdFoscam and then pass the result like this:
Code:
local snapshot = cmdFoscam(...)
local attachment = ltn12.source.chain( ltn12.source.string(snapshot), ltn12.filter.chain(mime.encode('base64'), mime.wrap()) )