curl post的shell

outputfile="/home/app/java_trans/"
cd $outputfile
#得到command执行结果 sourceMobile
=$(awk {print $0} output.txt |xargs |sed s/ /\\",\\"/g) #echo $sourceMobile mobiles="\"[\\\"${sourceMobile}\\\"]\"" #echo $mobiles #mobiles2="\"[\\\"9TDYwD2BqLVpx6/4LpQ==\\\",\\\"wE2xSOYDCHt/TcqU/A==\\\"]\"" #echo $mobiles2
#字符串拼接 bodydata
="‘{\"fileName\":\"A40320200925163333000130_2000.txt\",\"flag\":\"0\",\"data\":${mobiles}}‘" url="https://badi/yzfdafdf/send" #echo $bodydata posturl="curl -H \"Content-Type:application/json\" -X POST -d ${bodydata} ${url}" echo $posturl eval $posturl #curl -H "Content-Type:application/json" -X POST -d {"fileName":"A40320200925163333000130_2000.txt","flag":"0","data":"[\"9TDYwD2BqLVpxe/4LpQ==\",\"wE2xSOYDCHUHXncqU/A==\"]"} https://badi/yzfdafdf/send

 参考了这个文章

 

curl post的shell

上一篇:JS中如何获取select选中的值


下一篇:JS中var、let、const 的区别