一、使用批处理调用Curl 定时请求一个API接口:

    

   

 1 @echo off
 2 
 3 set /a count=0
 4 set /a max_count=999999999   --最大请求次数
 5 
 6 set currentDate=%DATE%  --显示系统日期
 7 set currentTime=%TIME%  --显示 系统日期
 8 
 9 :loop
10 if %count% equ %max_count% goto end
11 
12 curl -X post  http://192.200.2.99:9099/Api/Task/InvoicePdf -w "\n%currentDate% %currentTime%\n"
13 timeout /t 60  > nul   --60秒请求一次
14 set /a count+=1
15 goto loop
16 
17 :end
18 echo "API request finished"

 

posted on 2023-07-06 16:07  EEEEEEEEEEEEEEEEEEE  阅读(259)  评论(0编辑  收藏  举报