.bat文件实现一个简单的http请求工具(支持get和post请求)
利用win10支持curl命令的原理,构造参数发送请求
代码:
@echo off
:again
set /p web=please input web url:
set /p method=please input method:
if %method%==PUT (goto :TransferData) else (if %method%==POST (goto :TransferData) else (curl -v -X %method% -H "Content-Type: text/html; charset=UTF-8" %web%))
goto :again
pause
:TransferData
set /p data=please input data:
curl -v -X %method% -H "Content-Type: text/html; charset=UTF-8" -d %data% %web%
goto :again
成品运行截图:
本文来自博客园,作者:明金同学,转载请注明原文链接:https://www.cnblogs.com/vmuu/p/18599479
公众号:【明金同学】