Posted to tcl by mjanssen at Sat Aug 15 12:34:03 GMT 2009view pretty

proc downurl {url {token {}}} {
  if {$token eq {}} {
	return [http::geturl $url -command [list downurl $url]
  }
  if {[http::ncode $token] == 302} {      
      puts "handle redirect to [dict get [http::meta $token] Location] by calling downlurl again"
      downurl [dict get [http::meta $token] Location]
  } else {
      puts "no redirect"
      parray $token 
 }
  http::cleanup $token
}

http::wait [downurl blabla]