tcl模拟ruby REST请求

时间:2013-11-19 20:52:03

标签: rest web tcl

我有以下ruby代码(来自Codeacademy API课程)。

require 'open-uri'

# Open http://placekitten.com/ for reading on line 4!
kittens = open('http://placekitten.com')
body = kittens.read[559, 441]

# Add your puts statement below!

puts body

如何在tcl中编写?

1 个答案:

答案 0 :(得分:2)

如果我理解正确,你只想转储文件?如果是这样,以下是最小代码:

package require http
puts [http::data [http::geturl "http://placekitten.com"]]