shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/tasks/ <<EOF
{
"name" : "SampleTask",
"command" : "(function(params) { require('internal').print(params); })(params)",
"params" : {
"foo" : "bar",
"bar" : "foo"
},
"period" : 2
}
EOF
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
{
"id" : "862984914",
"name" : "SampleTask",
"type" : "periodic",
"period" : 2,
"created" : 1452621383.407514,
"command" : "(function(params) { require('internal').print(params); })(params)",
"database" : "_system",
"error" : false,
"code" : 200
}
shell> curl -X DELETE --dump - http://localhost:8529/_api/tasks/862984914