Attachments example:
curl -v -u admin:password -F 'data={"method": "mail.send", "params": [{"subject": "foo", "to": ["foo@gmail.com"], "html": "foo", "attachments": true}]}' -F "file=@/tmp/attachment" http://127.0.0.1/_upload/
/tmp/attachment is a json:
[
{
"headers": [
{
"name": "Content-Transfer-Encoding",
"value": "base64"
},
{
"name": "Content-Type",
"value": "application/octet-stream",
"params": {
"name": "test.txt"
}
}
],
"content": "dGVzdAo="
}
]
Granted, not straightforward at all, but definitely easier in some language like python than shell script