alias httpreq {
var %p | if ($1 == -p) { %p = 1 | tokenize 32 $2- }
sockwrite -n $1 $iif(%p == 1,POST,GET) $3 HTTP/1.1 $+ $crlf $+ Accept: */* $+ $crlf $+ User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) $+ $crlf $+ Host: $2 $+ $crlf $+ Connection: Keep-Alive $+ $iif($4,$crlf $+ Referer: $4) $+ $iif($5,$crlf $+ Cookie: $5) $+ $iif($6,$+($crlf,Content-Type: application/x-www-form-urlencoded,$crlf,Content-Length: $len($5),$crlf,$6))
if (%p == $null) { sockwrite -n $1 }
}