Do a search for ns_httpget and see "Exercise 4: Tcl pages that query foreign servers" here:
http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-171Fall2003/Assignments/detail/problem_set_1.htm
might be outdated, but it might give you some ideas.