Code: Select all
set token [::http::geturl $itrurlg -blocksize 50]
Code: Select all
package require http
proc yourCallback {sock tok} {
while {[gets $sock line]==0} continue;# read untill we get a non-empty line or eof
puts $line;# you probably want to do something else here :)
http::reset $tok;# i'm not sure this one's needed, but I included it anyway :P
http::cleanup $tok;# this one's mandatory
}
http::geturl http://www.your.url/ -handler yourCallback -command nah -timeout 20000
This is what i was wanting to do in the first place.. not transfer un-needed data.user wrote:yeah..that's a good idea as you'll also avoid wasting lots of bandwidth transfering data you don't want/need.
Code: Select all
if {$text == ""} {
set token [::http::geturl $itrurlg]
set content [::http::data $token]
::http::cleanup $content
regsub -all -- {,} $content { } cont2
list $cont2
# for debug purposes
putlog "[lrange $cont2 0 end]"
return 0
} else {
Code: Select all
Date,Rating,Latency,Loss
13:25 6/15/2004,85,145,2
13:20 6/15/2004,85,144,2
Where would i change this in the http tcl?You might have to add a bit to it too, like the Host header (I think) and Connection: close.