util::request_info (public)
util::request_info [ -with_headers ]
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Produce a string containing the detailed request information. This is in particular useful for debugging, when errors are raised.
- Switches:
- -with_headers (optional, boolean, defaults to
"false"
)- Include request headers
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set info "" if {[ns_conn isconnected]} { # # Base information # append info " " [ns_conn method] " [util_current_location][ns_conn url]?[ns_conn query]" " referred by '[get_referrer]' peer [ad_conn peeraddr] user_id [ad_conn user_id]" if {[ns_conn method] eq "POST"} { # # POST data info # if {[ns_conn flags] & 1} { append info "\n connection already closed, cooked form-content:" foreach {k v} [ns_set array [ns_getform]] { if {[string length $v] > 100} { set v "[string range $v 0 100]..." } append info "\n $k: $v" } } else { set ct [ns_set iget [ns_conn headers] content-type] if {[string match text/* $ct] || $ct eq "application/x-www-form-urlencoded"} { set data [ns_conn content] if {[string length $data] < 2000} { append info "\n post-data: $data" } } } } # # Optional header info # if {$with_headers_p} { append info \n [util::ns_set_pretty_print [ns_conn headers]] } } return $infoXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql