console - interactive console
The console.tcl script in the scripts subdirectory provides an interactive command line Tcl environment for developing and debugging Woof! applications.
In addition to the standard Tcl commands, the console provides a get command that emulates an HTTP GET request as shown in the sample output below.
(woof) 1 % get http://localhost/math/index HTTP/?? 200 OK Content-Type: text/html Cache-Control: no-cache Set-Cookie: woofsid=D2CEFE233AF96BA4D01C16E4C03DB99E; expires=Friday, 05-Jun-2009 03:47:54 GMT; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html> <head> <title>woof</title> <link rel='stylesheet' type='text/css' href='http://localhost/stylesheets/_yui-2-7-0b-reset-fonts-grids.css' /> </head> <body> <div id="doc3"> <div id="bd"> <div class="yui-g"> <form method='POST' action='http://localhost/math/add'> Enter the two numbers to be added:<br/> <input type='text' name='a'/> + <input type='text' name='b'/> <input type='submit' value='Calculate'/> </form> </div> </div> </div> </body> </html> (woof)
The get command will issue the equivalent of an HTTP request to the controller action /math/index (using the example from the Implementing controllers chapter) and print the content generated by Woof!, including HTTP headers and content. In case of errors, the error stack will also be printed and if desired, standard Tcl debuggers can be used for stepping through the code. Debugging is much easier in this environment compared to using a real Web server and browser.