18 February 2013

how to send json using curl?

Note:
This is for personal purpose only as reminder for future reference

This is code snippet example:
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{
"@class": "dms.pastor.model.C
ampaign",
"campaign": {
"list": {
"id": "1aa4e31ae",
"members": [{
"firstName": "Edison",
"lastName": "Trent",
"mail": "edisontrent@fake.email"
},
{
"firstName": "Casper",
"lastName": "Orillion",
"mail": "CasperOrillion@fake.email"
}]
},
"template": {
"name": "Xmas",
"source": "xmas2019.zip",
"version": "1.0"
}
}
}' http://localhost:8080/campaignprocessor/