Tho*_*ker 11 batch-file httpwebrequest
我需要从Plesk的Task Scheduler执行一个http Web请求(在Windows/ASP.NET上使用共享主机;无论如何都没有Powershell).考虑为此使用批处理文件.
是否有捷径可寻?
npo*_*aka 17
没有外部二进制文件 - 只有内置的Windows功能 - > https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/winhttpjs.bat
这是jscript/.bat混合型,可以称为简单的蝙蝠.示例用法(我使用http://requestb.in/进行测试):
call winhttpjs.bat "http://requestb.in/xxxxxx" -method POST -header hdrs.txt -reportfile reportfile2.txt
call winhttpjs.bat "http://requestb.in/xxxxxx" -method GET -header hdrs.txt -reportfile reportfile3.txt -saveTo c:\somezip.zip
call winhttpjs.bat "http://requestb.in/xxxxxx" -method POST -header hdrs.txt -reportfile reportfile2.txt -saveTo responsefile2 -ua "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" -body-file some.json
Run Code Online (Sandbox Code Playgroud)
头文件格式应该如下(如果使用-header命令参数传递):
Header-1: Value-1
ExampleHeader: Value2
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
36395 次 |
| 最近记录: |