xo::MessageRelay method start_of_page (protected)

 <instance of xo::MessageRelay[i]> start_of_page mode

Defined in packages/xotcl-core/tcl/message-relay-procs.tcl

Compose reply header.

Parameters:
mode

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
Source code:
if {$mode eq "scripted"} {
  set content_type "text/html;charset=utf-8"
  set encoding "Cache-Control: no-cache\r\nTransfer-Encoding: chunked\r\n"
  set body "<html><body>[string repeat { } 1024]\r\n"
  set body [format %x [string length $body]]\r\n$body\r\n
} else {
  #
  # Chrome refuses to expose partial response to ajax unless we
  # set content_type to octet stream.  Drawback is we have to
  # force the translation on the channel.
  #
  set content_type "application/octet-stream"
  set encoding ""
  set body ""
}
return "HTTP/1.1 200 OK\r\nContent-type: $content_type\r\n$encoding\r\n$body"
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: