Class ::xo::HttpRequestTrace
::xo::HttpRequestTrace
create ...
Class Relations
- class: ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xotcl::Object
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xotcl::Class create ::xo::HttpRequestTrace \
-superclass ::xotcl::Object
Methods (to be applied on instances)
POST (scripted)
:instvar F post_data
puts $F "Content-Length: [string length $post_data]"
puts $F "Content-Type: [:content_type]"
puts $F ""
fconfigure $F -translation {auto binary}
puts -nonewline $F $post_data
nextcancel (scripted)
catch {close ${:F}}
nextfinish (scripted)
catch {close ${:F}}
nextinit (scripted)
:instvar F post_data
set :meta [list]
set :requestCount [nsv_incr HttpRequestTrace count] ;
set F [open [ad_tmpdir]/req-[format %.4d ${:requestCount}] w]
set method [expr {$post_data eq "" ? "GET" : "POST"}]
puts $F "$method [:path] HTTP/1.0"
puts $F "Host: [:host]"
puts $F "User-Agent: [:user_agent]"
foreach {tag value} [:request_header_fields] { puts $F "$tag: $value" }
next