You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-user@tcl.apache.org by Jerry Lam <bo...@hotmail.com> on 2003/11/26 01:15:18 UTC
http body
Hi,
When I use tcl http package to request the body (content of the url) of a websh page, it returns me a list {digit1 body digit2} which I don't understand why. Do you have an idea of what is going on?
Aparently, digit1 is the length of the body. But I have no idea of what digit2 is.
The funniest thing is when I request the page through the web browser, it doesn't have digit1 and digit2 in the body, I wonder what is wrong?
Thanks,
Jerry
Re: http body
Posted by Philipp Knüsel <ph...@gmx.ch>.
Hi Jerry
I think this is a http question, no websh problem.
I used http against websh generated pages and it didn't show the effect
you describe. You may find this example usefull (it uses aswell
Authorization):
- example ---------------------
package require http
package require base64
proc buildHeader {username password} {
return [list "Authorization" \
[concat "Basic" [base64::encode $username:$password]]]
}
set url http://your-page
set tok [http::geturl $url -headers [buildHeader yourname yourpassword]]
puts [http::data $tok]
-------------------------------
Sorry for being off-topic.
Philipp
Re: http body
Posted by Ronnie Brunner <ro...@netcetera.ch>.
> When I use tcl http package to request the body (content of the url)
> of a websh page, it returns me a list {digit1 body digit2} which I
> don't understand why. Do you have an idea of what is going on?
> Aparently, digit1 is the length of the body. But I have no idea of what digit2 is.
> The funniest thing is when I request the page through the web
> browser, it doesn't have digit1 and digit2 in the body, I wonder
> what is wrong?
Seems to be a http package issue, not a Websh issue, unless you
actually output something of the form you describe. However, a "view
source" in the browser would certainly also show {digit body digit}
Ronnie
----------------------------------------------------------------------
Ronnie Brunner ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich phone +41 1 247 79 79 fax +41 1 247 70 75