An example of how to call Bandicoot from Tcl

12 views
Skip to first unread message

Roman Mishin

unread,
Jul 27, 2011, 3:31:27 AM7/27/11
to bandicoot
Here is one of the Getting Started examples at http://bandilab.org/getting-started.html
, translated to Tcl:

--
package require http

set fileHandle [open duplicate.csv rb]
set fileContent [read $fileHandle]
close $fileHandle

set token [::http::geturl http://localhost:12345/Echo -query
$fileContent]

set result [::http::data $token]
::http::cleanup $token

puts $result
--

Tcl's csv package can be used to parse resulting csv output.

-
Roman

Roman Mishin

unread,
Jul 27, 2011, 4:18:44 AM7/27/11
to bandicoot
To prevent Tcl from defaulting to iso8859-1 charset, add:

set ::http::defaultCharset utf-8

before calling :http::geturl.

-
Roman
Reply all
Reply to author
Forward
0 new messages