#!/bin/bash
if [ -z $1 ]; then
echo "need set receiver"
exit 1
else
receiver=$1
echo "receiver id is: $receiver"
fi
while read -r line
do
sender_id=$(echo "$line" | cut -d ',' -f 2)
curl -X POST \
http://www.xxx.com/api/……(接口地址) \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{//post请求的body内容}'
sleep 0.02
done < "user_id.csv"
注意事项:需将user_id.csv放置在脚本所在的路径下