如何一次又一次地调用 URL
How to call an URL again and again
这是我调用 URL
的代码
@if (@This==@IsBatch) @then
@echo off
setlocal enableextensions disabledelayedexpansion
wscript //E:JScript "%~dpnx0" "http://abcd.com/xyz=lo"
exit /b
@end
var http = WScript.CreateObject('Msxml2.XMLHTTP.6.0');
var url = WScript.Arguments.Item(0)
http.open("GET", url, false);
http.send();
WScript.Quit(0);
这只调用 url http://abcd.com/xyz=lo
一次
现在我想在响应代码为 200 时调用 URL,所以我这样做了
:loop
http.open("GET", url, false);
http.send();
if(http.status==200)
{
}
else
{
goto loop
}
但它不起作用(即使状态为 400,它也不会调用 url)
试试
....
do {
try {
http.open('GET', url, false);
http.send();
} catch (e){
}
} while (http.status != 200);
....
这是我调用 URL
的代码@if (@This==@IsBatch) @then
@echo off
setlocal enableextensions disabledelayedexpansion
wscript //E:JScript "%~dpnx0" "http://abcd.com/xyz=lo"
exit /b
@end
var http = WScript.CreateObject('Msxml2.XMLHTTP.6.0');
var url = WScript.Arguments.Item(0)
http.open("GET", url, false);
http.send();
WScript.Quit(0);
这只调用 url http://abcd.com/xyz=lo
一次
现在我想在响应代码为 200 时调用 URL,所以我这样做了
:loop
http.open("GET", url, false);
http.send();
if(http.status==200)
{
}
else
{
goto loop
}
但它不起作用(即使状态为 400,它也不会调用 url)
试试
....
do {
try {
http.open('GET', url, false);
http.send();
} catch (e){
}
} while (http.status != 200);
....