Re: Tclhttpd: why not return the HTTP status from Direct_Url?



On Mar 30, 5:04 pm, EL <eckhardnos...@xxxxxx> wrote:
Hi all,

I just had a look at the Direct_Url command in tclhttpd, which installs
all procedures in a namespace as URL's, e.g.

I believe tnamespace convention is your own design (given the syntax
you use) and not something that tclhttpd does automatically.



Direct_Url /hello ::hello::
proc ::hello::/world {args} {
...
return "<b>hello world</b>"

}

Is there any particular reason to not return the HTTP code from
Direct_Url's, so that e.g. one can define ::hello::/world like this:

proc ::hello::/world {args} {
...
return -code 400 "<i>wrong # args, should be ...</i>"

}

??


Perhaps it is so because there is a separate API call just for that
and it is more general:

Httpd_AddHeaders $socket $header $value


Hope this helps...


.