我能够通过bash脚本中的循环,用curl发送JSON格式的数据。
Current
$(curl -o /dev/null -s -X POST “${url}" -H "accept: application/json" -H "Authorization: ${base}” -H "Content-Type: application/json" -d “{\”data1\”:\”${data1}\”,\”data2\”:\”${data2}\”}”)
"data1": "data1",
"data2”: "data2”
"data3”: "data3”,
"data4”: "data4”
但我的要求是用curl在JSON数组中实现以下格式。请帮助我实现用curl命令在循环的每一次迭代中追加JSON。
{“Array": [
"data1": "data1",
"data2”: "data2”
"data3”: "data3”,