Forum OpenACS Q&A: passing session forward to ns_httpget
So I want to forward the header information in the current page (tcl script) on to the page I'm calling. I have tried everything I can think of with ad_conn, ns_set, ns_httpget, and ns_geturl.
Can anyone please hlpe me? Thx.
This is comand works:
set result [ util_httpget $my_url [ns_conn headers] ]
but this command does not:
set result [ ns_geturl $my_url [ns_conn headers] ]
Could anyone explain the difference to me? Thx.
util_httpget is coded in Tcl. ns_geturl is written in C. IIRC, the C implementation of ns_geturl calls one of two different C functions depending on whether the URL is relative (/*) or absolute (http://*).
I'd be willing to bet that the relative url mechanism short-circuts some portion of the normal connection process and that the ns_set of headers is completely ignored. (Which seems like a rather silly policy to have coded into the C code, or, being charitable, a silly thing to go undocumented.)