BASE_URL="http://localhost:8199/fund/repayment/active"
4 CONTEXT="Content-type:application/json"
5 for line in `cat $1`
6 do
7 sleep 1
8 fStr=${line%,*}
9
10 echo $fStr
11 sStr=${line#*,}
12 echo $sStr
13
14 HTTP_CODE=`curl -l -H $CONTEXT -X POST -d '{"appId":"'"$fStr"'","userId":"'"$sStr"'","amount":"0.0","repayType":"0","repayStatus":"1"}' ${BASE_URL}`
15 echo $HTTP_CODE
16 done
json中花括号中测变量,先需要用“”扩起来,然后在用‘’号扩起来,这样变量就能传入json数据中
转载于:https://blog.51cto.com/wks97/1884560