; Call /urlget.test %url
alias urlget.test {
var %url = $iif($1,$1,http://localhost/)
bset -t &header 1 Test: Header
bset -t &body 1 foo1=bar1&foo2=bar2
var %id = $urlget(%url,gb,&target.dat,urlget.callback,&header) | ; Change from binvar to file for full speed
echo 4 -ag %id
timer 1 5 urlget.callback %id
;timer 1 6 echo 4 -ag here: $!urlget( %id ,c) | ; Uncomment to crash on binvar test
timers
}
alias urlget.callback {
var %id = $1
echo -agi9 url $urlget(%id).url
echo -agi9 redirect $urlget(%id).redirect
echo -agi9 method $urlget(%id).method
echo -agi9 type $urlget(%id).type
echo -agi9 target $urlget(%id).target
echo -agi9 alias $urlget(%id).alias
echo -agi9 id $urlget(%id).id
echo -agi9 state $urlget(%id).state
echo -agi9 size $urlget(%id).size
echo -agi9 resume $urlget(%id).resume
echo -agi9 rcvd $urlget(%id).rcvd
echo -agi9 time $urlget(%id).time
echo -agi9 reply $urlget(%id).reply
echo 4 -agi9 speed $bytes($calc($urlget(%id).rcvd * 1000 / $urlget(%id).time)).suf $+ /s
if ($urlget(%id).type == binvar) && ($bvar($urlget(%id).target)) {
echo -agi9 response $bvar($urlget(%id).target,1-3000).text
}
}